I had been working on a site where the client requested to use the Versi theme available on Theme Forest. The client, like many others that posted on RockNRollaDesigns’ support form, experienced the theme suddenly not loading any content! A little research uncovered the issue.
The code uses many custom queries such as:
1 2 3 4 5 6 7 8 | $args=array( 'post_type' => 'page', 'order' => 'ASC', 'orderby' => 'menu_order', 'posts_per_page' => '-1' ); $main_query = new WP_Query($args); if( have_posts() ) : |
Notice in the above code, the line that includes “have_posts()”. This was returning false so no content would load. The correct line of code should be:
1 | if( $main_query->have_posts() ) : |
The reason the code had originally worked is that the site had the sample post that is part of the initial WordPress install. Once that post was deleted and there were no other posts, the code no longer worked.
-0 Comments