• Has anyone heard of a reason why wordpress won’t accept a template for a page? I keep trying to create a “services” page with it’s own template, but when I view the page, it either loops using the index.php or archives.php files. I’m really confused about why it’s doing this since my other page templates are working correctly.

    Thank you

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    This is the template hierarchy for Pages: http://codex.wordpress.org/Template_Hierarchy#Page_display

    Did you create the custom Page template like this: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    Thread Starter polymaze

    (@polymaze)

    Keesiemeijer,
    Yes, I set up the template like that. I have three other templates all working fine, but for some reason the “services” page will not accept a custom template. I’ve tried switching it to the other templates that I have working, just to see if it would register that there was a template applied to it, but it still showed the archives.php loop.
    Thank you for the reply

    Moderator keesiemeijer

    (@keesiemeijer)

    That’s strange, archive.php is not even in the template hierarchy for Pages.

    Try:
    – deactivating all plugins to see if this resolves the problem? If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    – switching to the default theme to rule out any theme-specific problems.

    Thread Starter polymaze

    (@polymaze)

    OK, deactivating the plugins had no effect, however, when I changed the theme to twenty 11 the services page showed “home” in the h1 tags. I’m guessing that means it’s still running the index.php or archives.php loop.

    Moderator keesiemeijer

    (@keesiemeijer)

    Can you paste and submit the full code of your custom page template into a pastebin.com and post the link to it here? see the Forum Rules for posting code and using the pastebin.

    Thread Starter polymaze

    (@polymaze)

    Thread Starter polymaze

    (@polymaze)

    Any ideas on what’s going on? Thanks

    Moderator keesiemeijer

    (@keesiemeijer)

    On my test site it will accept your Page template. Do you have a custom taxonomy named “services” or that rewrites to “services”?
    Try (for testing) using a different Page title or diferent Page slug (i.e. not”services”).

    Thread Starter polymaze

    (@polymaze)

    Yup, that seems to be the problem. Thanks for that!

    What is the issue with using a taxonomy and page name that are the same if they are designed to be connected?

    Moderator keesiemeijer

    (@keesiemeijer)

    The urls are in conflict. The Page url is “mysite.com/services” and the taxonomy url is also “mysite.com/services”. Change the url of one of them to avoid this conflict.

    Thread Starter polymaze

    (@polymaze)

    Ok, thank you very much for helping me with this!

    Moderator keesiemeijer

    (@keesiemeijer)

    You’re welcome. Glad you got it resolved.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Template Switching’ is closed to new replies.