This little function is very useful since it will give you a taste of your next upcoming articles in your blog. A good way 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;?>
