Create Teasers for Future Posts in WordPress

No Comments
Show Future Posts in WordPress

photo credit: rjrgmc28

A steady stream of updates is a great way to keep your site’s audience engaged and to keep your search engine “friends” paying attention to your ever-growing collection of quality site content. But creativity and opportunity aren’t always constant commodities for the aspiring blogger.  One common tactic is to use those productive periods to write articles in advance (either in part or in whole) and then release them later, either through Scheduling or manually.  These posts aren’t available or visible to the public until the appointed time, however, making their existence kind of a mystery… but they don’t have to be.

Did you know you can create a teaser preview of your future posts using some simple code in WordPress?

The following code can be inserted directly into a template file, directly into the sidebar.php file or even use it to create a widget which you can then position just like any other widget in the WordPress Appearances.

<?php query_posts(‘showposts=10&post_status=future’); ?>

   <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

      <div >

         <p class><b><?php the_title(); ?></b><?php edit_post_link(‘Edit’,’ (‘,’)’); ?><br />

            <span class=”datetime”><?php the_time(‘j. F Y’); ?></span></p>

         </div>

<?php endwhile; else: ?><p>There are no future posts currently scheduled.</p><?php endif; ?>

In the first line you can define the maximum number of posts to retrieve and you can modify it to suit your needs.

Readers will be able to see the title of the post as well as the date it will be published, but they will not be able to click on it or view the pending post in any way. If you are an authorized administrator, editor, etc of the WordPress site, you will also see an editing link which will allow you to access the pending post and modify it as desired without going back through the WordPress Dashboard.

You can further customize this code using HTML/CSS to make it match your site.

Need help implementing this tip in your WordPress site? Contact us for our professional services.  We can also provide support & expertise in convenient “blocks” to suit your short and long term needs.

I'm the front-man of It's WordPress. I come from a diverse array of backgrounds, enjoying the opportunity to expand my knowledge base and skill set by re-inventing myself. I enjoy environments that focus on emerging information, technology and concepts. I put on the technical hat in my early 20s and never really looked back. I'm love technology and the internet, as well as the outdoors and avidly hike, kayak and camp every chance I get.

About Us

We can take you from concept, through design, development and deployment in one seamless process. Whether you choose a self-managed web site or need a continuing support relationship; we've got you covered.

Click to edit this heading

Request Consulation

Ready to transform your vision into a reality? Just looking to see what it takes to get the ball rolling. Tell us about your project and we can help. No spam. No obligation. Just answers.

More from our blog

See all posts

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.