futureposts1

Often at the end of a TV show, they play some clips of what’s coming up in the next episode. It’s interesting to watch (Provided they don’t spoil things too much on you!), simple for them to do, and near enough guarantees you’ll remember to tune in again next time.

So why not do the same with your blog?

If you use WordPress’s future-posting to schedule your posts for a few days in advance, you can show parts of those posts on your blog beforehand to let people know there’s more to come.

Why Use It?

Let’s say a reader visits your blog and sees a headline that they love the sound of but can’t access yet, it’s going to get their curiosity up.

What if the headline promises to teach them something they’d love to learn? Will they remember to come back next week? What about remembering the blog address?

Hmm…. maybe not. Maybe it would be easier just to subscribe.

Score!

How To Set It Up

If you’re familiar with the WordPress loop, you’ll understand this code instantly. All we are doing is setting up a custom query to get your upcoming posts, and then display them like you would any other set of posts.

If you copy and paste the code below into your sidebar, you will get a list of all the upcoming posts on your blog.

<ul>
<?php $my_query = new WP_Query('post_status=future&amp;order=ASC'); ?>
<?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Read <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; else: ?>
<li>No posts scheduled right now.</li>
<?php endif; ?>
</ul>

A More Advanced Example

Because this functions as a normal WordPress loop, you can do anything you like with it. In this case, we’re adding a custom field with the key “byline” to each of the posts and then displaying that byline on the page with the post title and date it will be published underneath.

<?php $my_query = new WP_Query('showposts=5&amp;post_status=future&amp;order=ASC'); ?>
<?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?>
<?php //get byline (custom field) ?><?php $byline = get_post_meta($post->ID, 'byline', true); ?>
<h3><?php echo $byline; ?></h3>
<p><?php the_title(); ?> <small><?php the_time('M jS g:i A') ?></small></p>
<?php endwhile; else: ?><h3>No upcoming Events</h3>
<?php endif; ?>

Now what if you had used an image as your custom field? Would the image be intriguing enough to get them to come back? You have a lot of options!

The “Subscribe Now!” Pitch

Everyone’s blog displays their chosen RSS icon and usually a few words like “Subscribe to my feed.” Simple stuff, hard to make it unique.

But now we can use this code to add something dynamic and different to your pitch.

The following code will output the line “Subscribe to my feed to get updates sent to you for free, including The Best Ever WordPress Tricks, due out on Monday!” (Assuming you have a post called The Best Ever WordPress Tricks, set to be published on a Monday!)

And if you don’t have a post scheduled at a certain time, it will just display the regular greeting.

<?php $my_query = new WP_Query('showposts=1&amp;post_status=future&amp;order=ASC'); ?>
<?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?>
<p>Subscribe to my feed to get updates sent to you for free, including <?php the_title(); ?>, due out on <?php the_time('l') ?>!</p>
<?php endwhile; else: ?><p>Subscribe to my feed to get updates sent to you for free!</p>
<?php endif; ?>

That’s 3 possibilities for you already in this post alone. What else can you think of?

One idea that milo has put in to use on F1 Ezine is to count down to upcoming events. Check out the “Next Grand Prix” countdown in the sidebar. That’s all done by querying for upcoming posts in a grand-prix category.

milo WordPress Hacks Series: The code in these posts was written entirely by Milo, a web designer from Oxford, Britain. Check out her website for free WordPress themes and her blog, or follow her on Twitter!

Enjoy this post? You should follow me on Twitter!