{"id":4291809,"date":"2013-11-06T10:06:18","date_gmt":"2013-11-06T10:06:18","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/working-code\/"},"modified":"2016-08-21T12:17:45","modified_gmt":"2016-08-21T12:17:45","slug":"working-code","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/working-code\/","title":{"rendered":"Working code :)"},"content":{"rendered":"<p>I should use this code (this will also ignore the sticky posts):<\/p>\n<pre><code>&lt;ul&gt;\n    &lt;?php\n    $args = array(\n     &#039;post_status&#039; =&gt; &#039;future&#039;,\n     &#039;ignore_sticky_posts&#039;    =&gt; true,\n     &#039;posts_per_page&#039; =&gt; 5,\n     &#039;order&#039; =&gt; &#039;DESC&#039;\n    );\n    $my_query = new WP_Query($args);\n    if ($my_query-&gt;have_posts()) {\n        while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post();\n\n            $do_not_duplicate = $post-&gt;ID; ?&gt;\n            &lt;li&gt; &lt;?php the_title(); ?&gt;\n            &lt;span class=&quot;post-date&quot;&gt;Expected: &lt;?php echo get_the_date(&#039;Y-m-d&#039;);?&gt;&lt;\/span&gt;\n            &lt;\/li&gt;\n        &lt;?php endwhile;\n    }\n    ?&gt;\n    &lt;\/ul&gt;<\/code><\/pre>\n<p>https:\/\/wordpress.org\/plugins\/upcoming-posts\/<\/p>\n","protected":false},"template":"","class_list":["post-4291809","topic","type-topic","status-closed","hentry","topic-tag-list","topic-tag-posts","topic-tag-wp_query"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4291809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4291809\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4291809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}