• Resolved pubsforplebs

    (@pubsforplebs)


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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?

    There is one basic Loop that can be used in pretty much any template (see the TwentyTen them for an example of this) but this Loop has to be placed (or called into) each of the various template files.

    Thread Starter pubsforplebs

    (@pubsforplebs)

    Well, it looks like the reason things aren’t working is because some pages on my site aren’t responding to edits I’m making to the templates using the theme editor.

    I’m baffled. These are templates I’ve already edited successfully numerous times the exact same way I’m doing now.

    I checked the permissions through Bluehost, and they’re the same as any of the other templates I can edit.

    Any ideas, or should I do a new post with a new subject line for this separate problem?

    Thread Starter pubsforplebs

    (@pubsforplebs)

    An update (but no resolution yet): I just checked the particular php file I’m working on in my ftp editor, and the edits I’ve made through the WP theme editor haven’t taken.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The loop and pages’ is closed to new replies.