This topic has 2 replies, 2 voices, and was last updated 8 years by HDcms.

  • Author
  • #80249
     HDcms
    Participant

    Hi,

    I display an information notice when I’m on the profile page.
    Everything works fine.
    I am now display a notice on all buddypress pages (profile, groups, messages …)

    I tried several do_action but none works.
    I use a child theme (or bp_custom.php)

    COPY CODE
    
    // NOK
    add_action( 'after_header_content', 'action_bp_before_container', 10, 0 );
    function action_bp_before_container(  ) 
    {
         echo "after_header_content";
    }
       
    add_action ( 'bp_after_header', 'test_titre' );     
    function test_titre(){
    echo '<h3>HA HA HA</h3>';
    }
    
    add_action( 'kleo_after_header', 'welcome_msg' );
    function welcome_msg(){
        echo "kleo_after_header";
    }
    
    // OK
     add_action( 'bp_before_member_home_content', 'action_bp_before_profile_edit_content', 10, 0 );
     function action_bp_before_profile_edit_content(  )  
        {
            echo "<h1>bp_before_member_home_content 1/10</h1>";
        }
    

    Regards

    #80255
     sharmstr
    Moderator

    *ALL* bp pages? Or just all BP Profile screens?

    COPY CODE
    
    // Show notice in member profile
    add_action('kleo_before_content','add_bp_profile_notice');
    function add_bp_profile_notice () {
        if ( bp_is_user() ) {
            echo "I'm in a members profile";
        }
    }
    
    // Show notice on every bp page
    add_action('kleo_before_content','add_bp_notice');
    function add_bp_notice () {
        if ( is_buddypress() ) {
            echo "I'm on a bp page";
        }
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #80259
     HDcms
    Participant

    Hi,
    It works
    🙂
    Your support is great
    🙂
    Thanks

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

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

Log in with your credentials

Forgot your details?