WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Posts Page getting wrong custom template (7 posts)

  1. piratepaul
    Member
    Posted 6 years ago #

    Ok, so this is my first time using WP as a CMS and blog platform in the same install.

    My problem relates to using templates, and is this:

    I created 3 templates within my theme (one for the home page, one for the posts page, and one for everything else) everything works fine except that the posts page seems to want to use a template that I have not assigned to it.

    The templates display fine in the drop down from the Write Page page.(as far as I can tell, I used the standard method of creating custom templates

    <?php
    /*

    Template Name: postspage

    */
    ?>
    )

    The problem persists even when I change the posts page. basically, I can't seem to assign a custom template to the page with the posts, the custom template doesn't "stick"!

    The site can be viewed here:
    http://realestateauctioncourse.com/

    Thank you so much for any help

    Paul

  2. acurran
    Member
    Posted 6 years ago #

    Same problem here. In my case it worked at first. Then I moved the site to another server/domain name and upgraded to WP2.5 and now template wont stick for the posts page. I've checked all settings over & over again but can't find the problem.

  3. Joni
    Member
    Posted 6 years ago #

    Did you want the custom template to be your front page (where all the posts are listed in chrono order? If so, you need to edit your index.php file. If you want them on single posts, edit your single.php file, on archive posts, archive.php and so forth. You created a Page template, not a custom post template. Pages lie OUTSIDE post hierarchy so that's why the custom page template wasn't being applied. Does this make sense?

    You can use conditional statements to make things look just about any way you want. Read about those here:
    http://codex.wordpress.org/Conditional_Tags

  4. acurran
    Member
    Posted 6 years ago #

    I solved the problem on my site by removing the home.php template. Doing so allowed the custom template to take hold on the posts page.

    B.t.w. I have WP setup as a CMS so front page is a WP page - no posts.

    piratepaul - this may be the way you have it to - so try removing home.php (or you can rename it to a different name e.g. homepage.php)

  5. piratepaul
    Member
    Posted 6 years ago #

    Wow, conditional tags seriously rock. Thats all I have to say!
    Thanks Joni.

  6. Malin
    Member
    Posted 6 years ago #

    Thank you acurran!
    I have two "identical" sites, but two different languages. Couldn't figure out why the swedish one worked and not the english. Of course my template was called home.php on the english site. I used swedsih for "home" on the one that worked and therefore it didn't conflict.

    I was just about to reinstall the whole english wp, when I found this thread.
    Thanks a lot!!!

  7. Tzaddi
    Member
    Posted 5 years ago #

    The home.php issue messed me up a while back and I couldn't figure out why. Now I realize it's because home.php is a reserved name.

    I just found this list of reserved template names, FYI
    http://codex.wordpress.org/Theme_Development#Theme_Template_Files_List

Topic Closed

This topic has been closed to new replies.

About this Topic