BuddyDev

Search

[Resolved] How to create a template

  • Participant
    Level: Enlightened
    Posts: 64
    David on #42318

    I very much like the nouveau template and would simply like to duplicate that and edit it to my liking. is there anything I need to look out for when doing this?

  • Keymaster
    (BuddyDev Team)
    Posts: 21849
    Brajesh Singh on #42338

    Hi David,
    Thank you for the question.

    You can copy the files from plugins/buddypress/bp-templates/bp-nouveau to themes/your theme (or child theme)/buddypress

    The bp-nouveau and bp-nouveau/buddypress (both) maps to “buddypress” directory in your theme/child theme. To override any template, you can copy it from bp-nouveau and put it in your theme’s buddypress directory while maintaining the same hierarchy.

    example:- bp-nouveau/buddypress/activity/entry.php can be overridden in your theme/buddypress/activity/entry.php

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 64
    David on #42344

    Yes, I know about this but I would prefer to use something other than BuddyPress or community for my folder name. But from what I have been told and heard I can’t do that.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2461
    Ravi on #42350

    Hello David,

    Try the filter ‘bp_get_template_locations’ provided by BuddyPress. Please check and let me know if it helps you or not.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 64
    David on #42369

    What code do I use for that filter? for some reason everyone seems to assume I am one.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2461
    Ravi on #42370

    Hello David,

    Try the following code

    
    add_filter( 'bp_get_template_locations', function ( $locations ) {
    	$locations[] = 'community-new';
    
    	return $locations;
    } );
    
    

    It will now check for a directory with the name ‘community-new’ for templates.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 64
    David on #42380

    Thank you so very much.

    Could you recommend any sources with detailed instructions on how to build a template? I wanted to just copy the nouveau template and edit it but I can’t do that due to the hard coding. I was told that I could just include the css but I don’t know how to do that at this moment.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2461
    Ravi on #42384

    Hello David,

    You may want to take a look at this

    https://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/

    That should help a little bit. There is not much available on template override other than it currently.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 64
    David on #42560

    Since I can’t do very much with template override.

    Is there any easy way to use nouveau’s design but also be able to change those files names? Would it be easier with legacy?

    I would also like to change the name and location of avatars and cover images.

  • Participant
    Level: Enlightened
    Posts: 64
    David on #42562

    If I have to start looking into making a custom template I will but I want to make sure I exhaust all my options first since I am not a coder.

You must be logged in to reply to this topic.

This topic is: resolved