How to show future articles in your WordPress blog


This little function is very useful since it will give you a taste of your next upcoming articles in your . A good wayHow to show future articles in your WordPress blog to indirectly retain your visitors by giving them the titles of your future posts.

This code can also serve as a small calendar if your blog publishing dates of events. By cons, if you blog about the news of the day; it will be difficult to guess the news of tomorrow.

We will retrieve all articles that have been programmed. Articles / Events are displayed in order of publication.


 

Here is the code that needed to be inserted in your sidebar by text widget or on the page of your articles, bottom of your posts anywhere as you like:

 

<ul> <? php $ my_query wp_query = new ('post_status = future & order = ASC');?> <? php if ($ my_query-> have_posts ()): while ($ my_query-> have_posts ()): $ my_query -> the_post ();?> <li> <? php the_title ();?> (<? php the_time ('j F Y') ?>)</ li> <? php endwhile; else:?> </ ul> <li> No items are scheduled </ li> </ ul> <? php endif;?>

 

Signature


0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
About Abhishek

Abhishek Ghosh is an Orthopedic Surgeon, Inventor with 216 Patents, Current editor of The Customize Windows Media Group. You can follow and know more about Dr. +Abhishek Ghosh on Google Plus and follow on Twitter as @AbhishekCTRL.

Speak Your Mind

*