{"id":6295075,"date":"2015-07-04T08:14:55","date_gmt":"2015-07-04T08:14:55","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/not-loading-posts\/"},"modified":"2016-08-30T15:08:11","modified_gmt":"2016-08-30T15:08:11","slug":"not-loading-posts","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/not-loading-posts\/","title":{"rendered":"Not loading posts"},"content":{"rendered":"<p>Hey great plugin<\/p>\n<p>Trying to get it to work in a Query loop<\/p>\n<p>heres my code<\/p>\n<pre><code>&lt;div class=&quot;content-container&quot;&gt;\n\n&lt;?php\n$paged = ( get_query_var(&#039;page&#039;) ) ? get_query_var(&#039;page&#039;) : 1;\n$args = array(\n&#039;post_type&#039; =&gt; array( &#039;post&#039;, &#039;review&#039;),\n&#039;posts_per_page&#039; =&gt; 8,\n&#039;paged&#039; =&gt; $paged\n);\n$the_query = new WP_Query( $args );\n?&gt;\n&lt;?php $post_counter=0; ?&gt;\n&lt;?php if ( $the_query-&gt;have_posts(&#039;paged&#039;) ) : ?&gt;\n&lt;?php while ( $the_query-&gt;have_posts(&#039;paged&#039;) ) : $the_query-&gt;the_post(&#039;paged&#039;); ?&gt;\n\n&lt;div id=&quot;post-item&quot;&gt;&lt;div class=&quot;post-&lt;?php the_ID(); ?&gt;&quot; &lt;?php post_class(); ?&gt;&gt;\n\n&lt;a href=&quot;&lt;?php echo the_permalink(); ?&gt;&quot;&gt;\n\n   &lt;div class=&quot;post-image&quot;&gt;\n\n             &lt;span class=&quot;wrapper-1&quot;&gt;\n\n              &lt;?php\n\t\techo get_the_post_thumbnail($post-&gt;ID, &#039;plant-thumb&#039;);\n              ?&gt;\n                   &lt;span&gt;\n\n                    &lt;?php\n                      \/\/ Get the Name of First Category\n                      $category = get_the_category();\n                      echo $category[0]-&gt;cat_name;\n                    ?&gt;\n\n                   &lt;\/span&gt;\n\n             &lt;\/span&gt;\n\n   &lt;div class=&quot;item-overlay&quot;&gt;\n\n      &lt;div class=&quot;post-title&quot;&gt;&lt;h4 class=&quot;title&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/h4&gt;&lt;\/div&gt;\t\n\n      &lt;div class=&quot;post-author&quot;&gt;\n\n      &lt;h2&gt;by&lt;\/h2&gt;&lt;?php echo get_the_author(); ?&gt;\n\n      &lt;\/div&gt; &lt;!-- post author --&gt;\n\n      &lt;div class=&quot;post-date&quot;&gt;\n\n      &lt;h2&gt;on&lt;\/h2&gt;&lt;?php echo get_the_date(); ?&gt;\n\n      &lt;\/div&gt; &lt;!-- post-date --&gt;   \n\n   &lt;\/div&gt; &lt;!-- item-overlay --&gt;  \n\n   &lt;\/div&gt; &lt;!-- post-image --&gt;\n\n&lt;\/a&gt;\n\n&lt;\/div&gt; &lt;!-- post-ID --&gt;\n&lt;\/div&gt; &lt;!-- post-item --&gt;\n\n&lt;?php\n$post_counter++;\nif ($post_counter == 8) { ?&gt;\n\n&lt;div class=&quot;ad-box-300x250&quot;&gt;\n\n&lt;SCRIPT language=&quot;Javascript&quot;&gt;\nvar cpmstar_rnd=Math.round(Math.random()*999999);\nvar cpmstar_pid=57604;\ndocument.writeln(&quot;&lt;SCR&quot;+&quot;IPT language=&#039;Javascript&#039; src=&#039;\/\/server.cpmstar.com\/view.aspx?poolid=&quot;+cpmstar_pid+&quot;&amp;script=1&amp;rnd=&quot;+cpmstar_rnd+&quot;&#039;&gt;&lt;\/SCR&quot;+&quot;IPT&gt;&quot;);\n&lt;\/SCRIPT&gt;\n&lt;\/div&gt;\n\n&lt;?php } ?&gt; \n\n\t\t&lt;?php endwhile; ?&gt;\n&lt;div class=&quot;post-pagination&quot;&gt;\n\n&lt;div class=&quot;post-next&quot;&gt;\n&lt;\/div&gt;\n&lt;\/div&gt;\n&lt;?php wp_reset_postdata(); ?&gt;\n&lt;?php else : ?&gt;\n&lt;p&gt;&lt;?php _e( &#039;Sorry, no posts matched your criteria.&#039; ); ?&gt;&lt;\/p&gt;\n&lt;?php endif; ?&gt;\n\n&lt;\/div&gt;\t&lt;!-- content-container --&gt;<\/code><\/pre>\n<p>It comes up with &#8220;no posts to show&#8221; under the first loop. How do i fix this? thanks<\/p>\n<p>Heres the website www.gamersgreed.com<\/p>\n<p>https:\/\/wordpress.org\/plugins\/unlimited\/<\/p>\n","protected":false},"template":"","class_list":["post-6295075","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6295075","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\/6295075\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6295075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}