BuddyDev

Search

[Resolved] activity

Tagged: 

  • Participant
    Level: Enlightened
    Posts: 94
    Ankit Raj on #31012

    what will be the shortcode for logged in users to view their activity history as seperate for themselves

  • Keymaster
    (BuddyDev Team)
    Posts: 24708
    Brajesh Singh on #31021

    Hi,
    If you are using BP legacy template pack,

    Please see the documenbtation for Activity shortcode
    https://buddydev.com/plugins/bp-activity-shortcode/

    If you are using the Nouveau template pack, I am not aware of any shortcode.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 94
    Ankit Raj on #31043
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24708
    Brajesh Singh on #31044
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 94
    Ankit Raj on #31048

    He said that you have to enable show a profile tab settings what’s this

  • Keymaster
    (BuddyDev Team)
    Posts: 24708
    Brajesh Singh on #31049

    Will you be able to provide me the context or sharing the link to code shared?

    Your replies have been not helping with the issue and if they continue like this, we won’t be able to assist you any further.

    If you need us to help you, Please provide us details, context to help us resolve issues quickly.

    Not providing details just wastes our time and energy.

    Thank you for understanding.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 94
    Ankit Raj on #31051

    Ravi wrote:

    Hello Ankit,

    Above code provided just a sample code How to add a nav item using code. Please try the following code in your active theme “functions.php” file. It will add a menu with name “Visitors” and count. Please make sure you have enabled “Show a profile tab?” setting.

    
    /**
     * Add visitors link
     *
     * @param string   $items The HTML list content for the menu items.
     * @param stdClass $args  An object containing wp_nav_menu() arguments.
     *
     * @return string
     */
    function add_visitors_link( $items, $args ) {
    
        if ( ! is_user_logged_in() || ! function_exists( 'buddypress' ) || ! function_exists( 'visitors_get_profile_visit_count' ) ) {
            return $items;
        }
    
        $visitors_count = visitors_get_profile_visit_count( bp_loggedin_user_id() );
    
    	$visitors_tab_url = trailingslashit( bp_loggedin_user_domain() . 'visitors' );
    
    	$items .= sprintf( '<li><a href="%s">%s <span>%s</span></a></li>', esc_url( $visitors_tab_url ), __( 'Visitors', 'buddypress' ), $visitors_count );
    
    	return $items;
    }
    
    add_filter( 'wp_nav_menu_items', 'add_visitors_link', 10, 2 );
    
  • Keymaster
    (BuddyDev Team)
    Posts: 24708
    Brajesh Singh on #31054

    Question:- How is this related to Activity? Isn’t it for visitors counter?

    Also, the link I shared to you for using code
    https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/

    Did you try that?

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 94
    Ankit Raj on #31087
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24708
    Brajesh Singh on #31090

    Hi Ankit,
    I have checked the original thread and I see that you had asked for a way to add “recent Visitors” to navigation menu.

    What he suggested that it is possible for a user to not have the “Recent visitors” component. So, he suggested you to make sure you have that enabled from the plugin settings if you plan to use the code.

    Regards
    Brajesh

The topic ‘ [Resolved] activity’ is closed to new replies.

This topic is: resolved