This topic has 7 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #157896
     wilfriedMarseille
    Participant

    Hello,

    i make some custom function for BuddyPress.

    To integrate it in a kleo child theme.
    I have to copy paste : buddypress/fbuddypress-function.php
    or make a new file bp-custom.php in kleochl/buddypress/bp-custom.php like the buddypress codex

    If you love Ableton check my blog :
    www.zikrea.com

    #157897
     wilfriedMarseille
    Participant

    I make this code in kleochild/buddypress/buddypress-function.php
    and a seconde time in : kleochild/buddypress/bp-custom.php

    COPY CODE
    <?php
    
    //On ajoute cet emplacement à la navigation de BP en passant par le fichier bp-custom.php
    
    function my_buddylinks_menu() {
     
    if( is_user_logged_in() ) :
     
        if ( has_nav_menu( 'bplink' ) ) {
            wp_nav_menu(array( 
                'theme_location'    => 'bplink',  
                'items_wrap'        =>'%3$s',        
                'container_class' => 'link-dropdown'
             ) );
        } 
     
    endif;
     
    }
    add_action( 'bp_member_options_nav', 'my_buddylinks_menu' );
    add_action( 'bp_group_options_nav', 'my_buddylinks_menu' );
    
    ?>

    And this code in function.php to add a menu name bplink in the dashboard/apparence/menu where i put a custom URL with # to make my new menu item in BuddyPress

    COPY CODE
    /*Personaliser le menu BuddyPress Le nouvel emplacement de menu se nomme bplink http://snippetbarn.bp-fr.net/ajouter-un-menu-personnalise-a-la-buddybar/  */
    function register_my_menu() {
      register_nav_menu( 'bplink', 'bplink' );
    }
    add_action( 'after_setup_theme', 'register_my_menu' );
    ?>

    But the new tem doesn’t come.

    Do you know why ?

    If you love Ableton check my blog :
    www.zikrea.com

    #158027
     Laura
    Moderator

    Hello 🙂 I will be happy to help you! If you could explain me a bit more of what is the idea then i can check it out for you, access to ftp and wp-admin could be helpful to test the codes too 🙂

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

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #158076
     wilfriedMarseille
    Participant

    Hello,

    The objective is reorganise my menu item order and add new item.

    With this way I make a new menu in my WP/Dashboard.
    where i can organise the BuddyPress Main nav in front end ( Activity, Prfile, Friends …. )
    (But my code is not working … )

    The idea is make an item name “bplink” in the buddypress main nav.
    And edit the template to this menu part.

    If you love Ableton check my blog :
    www.zikrea.com

    #158080
     wilfriedMarseille
    Participant
    This reply has been set as private.
    #158148
     wilfriedMarseille
    Participant

    So i find the code to add a menu item in the buddypress nav

    COPY CODE
    function custom_setup_nav() {
      global $bp;
    
      bp_core_new_nav_item( array( 
            'name' => __( 'Mes fichiers', 'buddypress' ), 
            'slug' => 'my-files', //domain.com/members/name/'SLUG' 
            'position' => 30, 
            'screen_function' => 'my-files_page'
      ) );
    }

    and for the redirection page i use this code in function php. but is not working i got a 404 error 🙁

    COPY CODE
    add_action( 'bp_setup_nav', 'custom_setup_nav' );
    
    function about_page() {
       add_action( 'bp_template_title', 'my-files_page_screen_title' );
       add_action( 'bp_template_content', 'my-files_page_show_screen_content' );
       bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    }
    
    function about_page_show_screen_title() {
        echo 'About Page';
    }
    
    function about_page_show_screen_content() {
       echo  '<h1>helloyou</h1>';
    }

    If you love Ableton check my blog :
    www.zikrea.com

    #158264
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

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

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #158464
     Radu
    Moderator

    Hi,

    This it’s something custom I cannot offer support for that, it’s to much time consumption.

    But I can guide you, try to inspire from here : https://archived.seventhqueen.com/forums/topic/bp-profile-search-inconsistent-behaviour

    https://buddypress.org/support/topic/adding-new-profile-tab-content/

    Good luck

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 8 posts - 1 through 8 (of 8 total)

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

Log in with your credentials

Forgot your details?