• Home
  • About Mitch
  • Speaking
  • Articles
  • Contact
  • Home
  • About Mitch
  • Speaking
  • Articles
  • Contact

Digital Strategist

WordPress Developer

Content Creator

Unapologetic Punk

Mitch Canter

  • X
  • Bluesky
  • GitHub
  • Twitch
  • YouTube
  • LinkedIn
Tutorial

Displaying Future Posts in WordPress

CMDR Mitchcraft

Reading time: 1 minute

If you do like I do and schedule posts ahead of time (especially on the podcast), there’s a way inside of WordPress to show your readers what posts are coming up next:

<?php
$my_query = new WP_Query('post_status=future&order=DESC&showposts=5');
if ($my_query->have_posts()) {
    while ($my_query->have_posts()) : $my_query->the_post(); ?>
        <?php the_date(); ?> - <?php the_title(); ?>
    <?php endwhile;
}
?>

This will display up to 5 “scheduled” posts wherever you drop in the code.  Add a headline <h2> tag if you want to give it a title (should you want to use it as a widget).

Want to see this code in action?  Check the WordPulse podcast page‘s sidebar to see it working!

Tips and Tricks, WordPress
  • Be a Uniter, Not a Divider

    Be a Uniter, Not a Divider

    Reading time: 2 minutes

    *I work in WordPress for my day job, but a reminder that my posts and thoughts are my own.* A word of advice to anyone in management – whether it’s a C-suite, mid-level manager, or even someone who just has people under them that see them as a mentor. Be someone who unites, not someone…

    WordPress
  • Using Hyperlinks Correctly in WordPress

    Using Hyperlinks Correctly in WordPress

    Reading time: 2 minutes

    Any good content marketer worth his or her salt knows the value of using links in their content. It’s a good strategy to practice – whether you’re linking internally to content you’ve written in the past or to external resources you mention in posts.  However, a lot of people overlook a small, single detail that could…

    WordPress