BuddyDev

Search

Recent Visitors, wrapping example code snippets

  • Participant
    Level: Yogi
    Posts: 1117
    calu on #42462

    Hi there

    I’m trying to list the recent visitors to a specific user including the unique visitors count, which I can see is possible in the example codes.

    I’m using a hook element with the visitors_show_my_recent_visitor(); code, but it need to be wrapped in.

    What is the difference using

    visitors_show_my_recent_visitor();

    to

    $users = visitors_get_recent_visitors( get_current_user_id(), $count = 5 );

    Examples or more documentation on how to wrap the two snippets would be much appreciated.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on #42463

    Hi there, I have also inserted the custom listing code snippet into the hook element, but the code does not render.

    https://buddydev.com/snippets/762-custom-listing-of-recent-visitors/

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #42464

    Hello Carsten,

    Thank you for posting. Function with name ‘visitors_show_my_recent_visitor’ will render the content from ‘recent-visitors/recent-visitors-header.php’ template file while function with name ‘visitors_get_recent_visitors’ will return the visitors for the user with how many to return threshold limit and for what period of time. you can use the result for your own custom loop.

    Please share your code so that I can assist you with the code.

    Regards
    Ravi

You must be logged in to reply to this topic.

This topic is: not resolved