• malisakyle

    (@malisakyle)


    Using Custom theme at wp-content/themes/themename/

    I have a custom page structure as thus:

    127.0.0.1/wordpress/discover
    127.0.0.1/wordpress/discover/local-life
    127.0.0.1/wordpress/discover/local-life/local-area

    In my theme root folder: tpl-discover.php (discover). In a separate folder(discover) I have template files tpl-local-life.php and tple-local-area.php.

    By having the template files outside the theme root folder, the body class is breaking.
    I’m getting the following when viewing each of the template pages.

    for 127.0.0.1/wordpress/discover/local-life:
    class="page page-id-6503 page-parent page-child parent-pageid-6461 page-template page-template-discover page-template-tpl-local-life page-template-discovertpl-local-life-php logged-in js"

    and for 127.0.0.1/wordpress/discover/local-life/local-area:
    class="page page-id-6506 page-child parent-pageid-6503 page-template page-template-discover page-template-tpl-local-area page-template-discovertpl-local-area-php logged-in js"

    Looking at it, its as though the parent template is not getting the -php added to the end, it just looks like its missing and thus not separating the two template classes.

    If I move the child templates to the theme root, it works fine.

    Any help on a fix, or ideas, greatly appreciated.

    Malisa

  • The topic ‘child template pages breaking body class’ is closed to new replies.