This topic has 3 replies, 2 voices, and was last updated 9 years by Abe.

  • Author
  • #25359
     nardyello
    Participant

    Hello, guys.

    Can anyone shed some light on this trouble I’m having? I’ve searched this entire forum and didn’t find exactly what I need. Maybe one of you might know how to help.

    I want to edit the Buddypress template files; at first, the member profile page.
    I want to make some changes to the HTML structure of the page and I need to change the page template itself and not only the Buddypress files.

    I found the files I need under:
    kleo > buddypress > members > single
    and also found the page template files:
    kleo > page templates

    I made a copy of the page template that I want, named it bp-profile-right-sidebar.php, edited it and put it in the kleo-child folder.
    Also got the CSS in there.
    Uploaded the files. All good.
    The changed made to the Buddypress files are okay.

    The page template shows up on the “Page Attributes” section correctly.
    I select it.
    And… nothing. Nothing happens.

    The page doesn’t get changed to the new template because (I believe) it only accepts the changes made in the Theme Settings page on the Buddypress tab. If I change the page template there, it gets changed in the actual member’s profile, but any template I select on the actual Page Attributes section doesn’t alter the layout of the page.

    I don’t really want to change any of the actual templates that are already there. If there’s a way to add a new template, I’d rather do that.

    Can you help me?

    Thank you in advance!

    #25374
     nardyello
    Participant

    Going through some of the code, I was able to:

    1. Add a page template image to Redux buddypress tab

    2. Added the following code to the kleo > functions.php file (just after the other page templates):

    COPY CODE
    case 'righttop':
    	add_action('kleo_after_content', 'kleo_sidebar');
    	remove_action('kleo_after_content', 'kleo_extra_sidebar');
    	add_filter('kleo_main_template_classes', create_function('$cols', '$cols = "col-sm-' . $main_width_2cols . ' tpl-righttop"; return $cols;'));
    	add_filter('kleo_sidebar_classes', create_function('$cols', '$cols = "col-sm-' . $sidebar_width_2cols . ' sidebar-righttop"; return $cols;'));
    	break;

    3. Added the following code to the kleo > lib > theme-functions.php file (just after the $kleo_config[‘tpl_map’] = array):
    'page-templates/right-sidebar-top.php' => 'righttop',

    4. Edited the kleo > lib > options.php file to include my new layout in the Redux Buddypress layout options

    But I still can’t call the template to be used by the theme.
    Can anyone inform me what I should do next?

    #25375
     nardyello
    Participant

    Here’s just an image to show what I said in points 1 and 4 of the last post.

    Attachments:
    You must be logged in to view attached files.
    #25555
     Abe
    Keymaster

    Hi there, I see what you are trying to do but that won’t load the template you defined since Buddypress uses the buddypress.php file template.

    The tpl_map was used for the Woocommerce pages.

    So what you could do is to edit the buddypress.php file and add there some conditions in the template for specific buddypress pages. For example to check if it is a members page you could use this function bp_is_user()

    See more on budddypress conditionals http://codex.buddypress.org/developer/template-tag-reference/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?