The loop and pages
-
So, I thought I understood all this, but now I’m kind of stumped. With regard to the loop, are there separate loops for each page of your site, or is there one loop for the entire site that you can place on any page? I thought the latter, but as I’m working on my site, it seems the former is the reality.
I have a static front page, and I’m trying to get it to display the latest post–by itself–from either of two categories. I have test posts in my main loop (the index loop, which I have made my “News” page for the time being), but when I try to query using this
<?php $recent = new WP_Query(“cat=1,3&showposts=1”); while($recent->have_posts()) : $recent->the_post();?>
plus all the stuff that usually comes after it related to styling the title and displaying comments and stuff, I get nothing on that “Home” page. If I go in and make an actual post on the home page, then something is there, obviously.
I’d like for there to be one main loop across all my pages that I can pull posts from, but I’m wondering if that’s not how this is set up.
- The topic ‘The loop and pages’ is closed to new replies.