Skip to:
Content
Pages
Categories
Search
Top
Bottom

Template hierarchy not respected


  • aborruso
    Participant

    @aborruso

    Hi all,
    I have an old blog with Twenty Eleven theme.

    I have copied “/wp-content/plugins/bbpress/templates/default” folders and file in my “/wp-content/themes/twentyeleven” folder.

    Then I have created forum.php file making a copy of page.php.

    When I modify forum.php there is any change in my website, it seems it reads another theme file.

    What’s wrong in my template structue? I have the bbpress folder copied before and these php files:
    404.php
    archive.php
    author.php
    bbpress-functions.php
    category.php
    comments.php
    content-aside.php
    content-featured.php
    content-gallery.php
    content-image.php
    content-intro.php
    content-link.php
    content-page.php
    content-quote.php
    content-single.php
    content-status.php
    content.php
    footer.php
    forum.php
    functions.php
    header.php
    image.php
    index.php
    page.php
    search.php
    searchform.php
    showcase.php
    sidebar-footer.php
    sidebar-forum.php
    sidebar-page.php
    sidebar.php
    single.php
    tag.php

Viewing 1 replies (of 1 total)

  • Robin W
    Moderator

    @robin-w

    I’m not quite sure what you are saying.

    For template file, you only need to copy files that you want to change to your theme, not all of them. If you haven’t done any changes then you don’t need to copy any files.

    Any TEMPLATE files you copy should be in a folder called bbpress ie
    wp-content/themes/twentyeleven/bbpress

    so if for instance you wanted to modify loop-single-fourm.php, you would copy it to that bbpress folder and modify it there – it would then be

    wp-content/themes/twentyeleven/bbpress/loop-single-forum.php

    The page template that bbpress will sue will be in the root of your theme ie

    wp-content/themes/twentyeleven

    and bbpress will look for file in the following order

    plugin-bbpress.php
    bbpress.php
    forums.php
    forum.php
    generic.php
    page.php
    single.php
    index.php

    so if you have copied and renamed page.php to forum.php, then bbpress should be using that file.

    so you file should be

    wp-content/themes/twentyeleven/forum.php

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.