BuddyDev

Search

How to display custom notice on activity page

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #19670

    Hello,

    How can I display a custom notice on both single activity and sitewide activity page when a user has less than 5 followings with a link to the members page encouraging the user to follow more people.

    E.g follow and connect with new friends at LINK(link to members page)

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #19678

    Hi Tosin,

    You will need to modify the template files. The overriding depends on which template pack you are using.

    Are you using BP Legacy or BP Nouveau?

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #19683

    I am using BP legacy

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #19690

    In that case, Please copy wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php to your theme/buddypress/activity/index.php and add the notice(this is activity directory page)

    and for members activity page copy bp-legacy/buddypress/members/single/activity.php to your theme/buddypress/members/single/activity.php and add the notice there.

    For adding the notice you can add code like this

    
    
    <?php if ( function_exists( 'bp_follow_get_the_following_count') && bp_follow_get_the_following_count( array( 'object_id' => get_current_user_id() ) ) < 5 ) : ?>
    	<div class="notice">Some message</div>
    <?php endif; ?>
    
    

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved