• Resolved hoss9009

    (@hoss9009)


    So I have two page templates w/ the the_content tag on it, along with multiple pages on the site. I have 1 of the page templates set as my home page and the other as my posts page. I have two sample posts on the site and EVERY page has the two posts on them.

    Why is this? What am I doing wrong?

    link

Viewing 8 replies - 1 through 8 (of 8 total)
  • I have 1 of the page templates set as my home page and the other as my posts page.

    You set pages as your Home and Post pages – not page templates.

    How many custom page templates do you have? Are they all different?

    Thread Starter hoss9009

    (@hoss9009)

    I have the home page as a template because it has a customer/different header. I designed index.php to be a 404, because technically, no one would ever see it. But for some reason the blog post page (page.php) it goes to my index. So i created the post template to pull the posts. It pulls the posts, but now (as you saw) every one of the pages.

    Any ideas? Should I post code?

    Thread Starter hoss9009

    (@hoss9009)

    Oh, also, the post page is a page template because it needs a specific header, too.

    You are using WP in a perverse manner. WP handles 404 requests anyway, and it uses index.php (the one that’s in your theme folder, not the one in the WP root) for posts/pages, etc. Posts should NEVER be on page.php, that’s what index.php is for.

    If you need a custom home page, create a template called main.php, welcome.php or something, then use that for your home page. Use index.php for your blog posts, and keep page.php for pages. Does this make sense?

    And you can use conditional tags to create different headers for different pages. Read about that in the Codex:

    https://codex.www.ads-software.com/Conditional_Tags

    Thread Starter hoss9009

    (@hoss9009)

    hahah perverse manner, hu? ??

    now what about the loop showing up on EVERY page?

    This concerns me more…

    ps. danke for the help thus far… changes are being made… i just wanna take care of this loop.

    Thread Starter hoss9009

    (@hoss9009)

    Ok i killed my post page template and fixed the conditional for the index. so now I have 1 page template (the home page), 1 index (looks like a page [via conditional tags], and the normal page.php.

    Still looping the hell out the site… i’ve never had this problem before!!!

    danke
    -eric

    Thread Starter hoss9009

    (@hoss9009)

    Ok… my recent posts tag in my sidebar was throwing it all off… i don’t get why, but i found some other script… thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘page template loop’ is closed to new replies.