Skip to:
Content
Pages
Categories
Search
Top
Bottom

Can I create template parts instead of full page?

  • @codemonkeybanana

    Participant

    Hi,

    I have created a buddypress.php file in root of my theme to setup general page and sidebar. This template uses the_content() so all the normal buddypress stuff loads up.

    I want to now offer my own files for the various template parts but I am doing something wrong.

    For instance, if I add this template part: my-theme/buddypress/members/single/index-component-profile.php it does not load it as a template part, it loads it as a full page template.

    I don’t want to create full template for every component, I want to make buddypress use the template parts.

    In the default theme inside plugin folder this is how it seems to work. Can I do it like this or do I have to use filters or something? The main plugin uses locate_template() to load all of these so I guess it’s possible, I am just not sure of the easiest/best way.

    How do I just build my templates for various sections?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • @shanebp

    Moderator

    If my-theme/buddypress/members/single/index-component-profile.php
    is your version of my-theme/buddypress/members/single/profile.php
    then don’t use a different file name.

    It’s much easier to do a template overload.

    Template Hierarchy

    Theme Compatibility & Template Files

    @codemonkeybanana

    Participant

    Thanks. I was getting all sort of conflicting advice but realised my mistake. I copied parts of legacy folder to my theme and it’s all simple to edit now. The fact default is called legacy and legacy is called default confused me so I had not taken right approach but it’s my fault for not reading carefully enough.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can I create template parts instead of full page?’ is closed to new replies.
Skip to toolbar