Show What’s Coming Next on Your Blog
37Often 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&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&post_status=future&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&post_status=future&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.
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!
This is a FREAKIN’ AMAZING little review/tutorial/post. I’ve been wanting to do something like this on my blog, but with my limited amount of jquerey and overall code knowledge (sigh….) I haven’t been able to add it.
I will try this tonight and will probably be asking you questions 5 minutes afterwards ha!
Glad you enjoyed it Justin! Let us know if you have any trouble, good luck! :)
I like the idea of this and your reasoning to do it, just so long as its your intention. I heard a while back some WP hack was found to dump out pending posts, link:
http://www.blackhatdomainer.com/how-to-know-today-what-shoemoney-is-going-to-post-tomorrow/
BTW, like your design; simplistic and inviting to read with good use of colours and fonts. I used to read your blog back in the day when you were PR zlich. Not popped over in a long time.
That’s a good point David, you have to be really certain you want people to see this. It wouldn’t work too well for people that use future posts as a way to hold their post ideas. But this will only ever show the number you tell it to (1?), so it would only be the next post they see, not all of them. :)
Thanks for the complement though, I’m glad you like it. Welcome back :D
Definitely nice trick, I use simple version at my blog and planning to improve it. btw if no posts are scheduled it simply hides so it don’t shows useless “nothing here” type of information.
Now I only need to be more thorough about writing posts ahead. :)
Rarst,
Sounds cool. That’s what I’ve done with the last script, much nicer than showing up an error message! :D
I could definitely see it working. When someone promises me an interesting article next week I just subscribe to RSS. And once the site is in my RSS folder it has to be really bad to make me delete it from there. It resides there and I read posts until I decide that it’s awful and I don’t want to read it anymore (this doesn’t happen often)
Pretty neat concept! I’m sure that this will be surely be used in blogosphere now. I’m just wondering that how many things are possible using this particular hack. This will surely help in generating the buzz that bloggers long for.
I can’t wait to implement this and the popular posts loop on my blog this weekend…You rock for sharing this! Thanks so much!
wow! your write up and coding steps are perfect! Thanks for another quality post!!
What a clever idea! It makes perfect sense, people love to know what is happening next. David Hopkins makes a good point here though, you probably wouldn’t want to give away all your ideas at once, so just one post ahead would work well.
Thanks for the code, its really useful and I’ll be looking into doing this myself :)
This is a great idea and very helpful information.
Another way to apply this concept is if you are sending a regular series of emails to your followers. Give them a taste of what is coming next time so they are more likely to open it and read it.
This is a really great tip and I have thought of it earlier. My only problem is to make sure I have enough posts lined up =)
Hi Michael,
This tip is really great. Thanks for sharing this kind of articles with the community. Keep the good job.
This would be perfect for my blogs – especially my food blog. Nothing beats teasing my readers with the next droolicious recipe :D
Wonderful tutorial and stumbled as a gesture of appreciation :D
Lovely tip, I am sure gonna incorporate into my blog. I am now startin to track your blog updates for helpful stuff.
Thanks.
Hey man thank you for your post, this is an interesting tip. I’m about to release a free software to manage users in active directory developed on ASP.net using Coolite controls and MVC to kind of give an idea of the things the control library is capable of. This is a good idea, specially to build up expectation and interest. Thank you for your posting.
I think this feature is great, and I have seen similar code elsewhere. My problem is that it also shows my sticky posts.
Is there som kind of possible sollution for that?
No one has yet been able to add some coding for the stickys not to whow. (if sticky then do_not_show)
Very good idea to show something few days in advance.. Nice! =)
Wow, such a simple trick, and yet so useful. Now all I need to do is start writing posts ahead of time! I think will would be particularly well suited to a series of posts, and I have one in mind :)
awesome, I was looking for something like that, our blog runs like a magazine so we are often quite far ahead and it would be great to give people a heads up. thanks
It helped me with ocean of knowledge so I really believe you will do much better in the future I appreciate everything you have added to my knowledge base.
Admiring the time and effort you put into your blog and detailed information you offer!
I din’t think this trick to make my blog more visited.
Thanks again.
Great piece of collection.Truly it’s very difficult to choose the best out of all because these are the topmost post. I have seen so far.
I appreciate the work that your are doing!!
Hey dear your blog is very much rocking and stunning. This blog has main attraction and high quality features. Due to the latest posts, this blog is relatively famous among the readers of allover the world. You have provided enough information on many different topics
I have been using the WordPress, just out of the box feature.
Would like to use some of the code you shared. thank you
Word Press is the best platform for blogging and is SEO friendly.
You need to have a blog if you do care about your SEO ranking.
Word Press is the best platform for blogging and is SEO friendly.
You need to have a blog if you do care about your SEO ranking.
thank fo for your share, great piece of collection.Truly it’s very difficult to choose the best out of all because these are the topmost post. I have seen so far. keep on.
I have seen so far. keep on.
Such an interesting post and thanks also for sharing. Some things in here I have not thought about before.Thanks for making such a cool post which is really very well written.will be referring a lot of friends about this.Keep blogging.
That is a fantastic idea! I really never thought about previews of upcoming blog entries or their subjects. Thanks!
Thanks for all the useful info!
that will really help us thanks for this tip
You completed some good points there. I did a search on the subject and found the majority of people will go along with with your blog.
Incredible designing, ultimately came across the source for fascinating background textures
i like it very good!