• I haven’t used wordpress in about a year and a half. I think I stopped using it right before custom post types were added. Anyway, back when I was using wordpress, when I wanted to display different content on each page, I would make a template for each page. For example, if I wanted to display posts from only one category on a certain page, I would make a new template and place a query template tag above the loop to limit the posts to one category.

    Long story short, I’ve got a site that’s been handed off to me by another developer halfway through completion and, being built on the newest version of wordpress, it is utilizing loop.php,loop-page.php ect, as the custom theme seems to be a copy of twentyten instead of a sandbox/bare bones theme.

    I have a page that needs to display posts from only one category, so I went about making a new template for the page with a WP_Query written into it and applied the template to the page in the admin. However it is still pulling content from all posts. It took me forever to figure out where the php was that was controlling the content on that page and it ends up being in loop.php. There aren’t any get_template_part() tags in the template file for this page, so I am baffled as to how the page is still being controlled by loop.php and not the template.php file that I have created.

    How do I override whatever code is in loop.php with the code in my template file?

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Page Templates and loop.php’ is closed to new replies.