Support » Themes and Templates » Problems with parent pages and templates

  • Resolved canutedechou


    im creating a site
    wicth have a section and subsections inside
    each part has a diferent template, and thats easy
    for example, the main page is


    and a subpage is


    but, when i create the subpage (service1) and apply service as a parent
    it doesnt show the template im choosing to use
    but, if i apply that subpage (service1) without services as a parent page, its working fine, and the template is working great

    the template of the subpage starts with:

    Template Name: Service1

    any idea of whats happening?


    u just fint out something really weird
    the problem is not in the template is in the url that wordpress is creating.
    for example i just go to the parmalinks options an set the links at the default option like ?p=123 but i want to use a special structure, just like “services/service1” so i go to “custom structure” and apply “/%postname%/”. when i do that, the template stop working, but if i set the permalinks on defaults, its working fine

    any idea? i suppose that is something on the custom structure

Viewing 15 replies - 1 through 15 (of 15 total)
  • Don’t use /%postname%/ as your PrettyPermalink structure.

    Use one of the date-based options. You’ll save yourself some headaches.

    yeah, i just realize that reading on codex
    but, how can i create friendly url without dates and without /%postname%/?


    All of the available options will append /%postname%/. The issue is with using /%postname%/ alone.

    If you use, e.g. “Year, Month, and Name”, your permalink structure will be:


    Edit: I guess that option is called “Month and Name”.

    yes, i was cheking that on permalinks options at wordpress panel, but the problem is that i cant use those kind of url, i need a more friendly name at the url bar on the explorer

    for example
    and no:

    but i was thinking
    i can apply the default permalink ?p=7 and use a plugin to create url for each page? or something like that?

    The Pretty Permalink structure indicated does not add year/month/etc. to Pages, but rather only to Posts.

    Pages are by definition static, and not date-based. WordPress is “smart” enough to differentiate between Posts and Pages in this manner (in fact, it is this very differentiation that allows the entire MOD_REWRITE rules to work in the first place – and why it causes such a performance hit not to append dates to the Post permalinks).

    i get that
    and i just apply /%year%/%monthnum%/%postname%/ to the permalinks
    the problem is that
    when i create a page inside services, for example
    that page that has a parent is not using the template wich i declare, but, if i say that service1 is NOT a parent of service, the template is working
    how can i make that the subpage use the template?

    What Page Template have you assigned to the Page in question?

    i have two pages, one is services, and another (lets call it “service1”) is a subpage of service, for example


    so, service has a template, and its working great
    then, i create service1 and apply another template and i declare that service1 has a parent wich is service

    when i apply that parent
    the template stop working, in fact, i thought it was a template problem, so i just apply the default template, and its happening the same, the template is not being showed

    (sorry, my english is not ver good)

    If you apply the default Template (i.e. “page.php”), does the Page render using that default Template?

    What is the name of the PHP file in which you have defined your custom Template (i.e. “page-foobar.php”)?

    no, if i apply to service1 the default template with service as a parent it doesnt render with the default template

    the template name is
    page-inner-services.php and starts with

    Template Name: Services Inner

    something weird just happend
    i just apply another name to service1, and the template is working fine
    i dont get it

    I suspect that the problem might be related to the template hierarchy.

    (Although it should respect a custom-applied template file, as the custom-applied template should take precedence) a Page called “Foobar”, with slug “foobar”, will attempt to use a template file called “page-foobar.php”.

    I would always name your Page template files according to layout (e.g. “page-one-column.php”, so as not to cause potential collision with the Page name/slug that you use for your Pages.

    well chip
    thanks a lot for the patience

    Not a problem. Glad you got it sorted out!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Problems with parent pages and templates’ is closed to new replies.