Hi Brajesh, I have inserted this shortcode
[bp-visitors-recent-visitors max=12 duration=1]
into a Gutenberg block.Fore some reason this shortcode creates an issue with the Heading block above, which is outputted in the header.
If i move the Heading block below the shortcode everything is ok.
None of the other shortcodes I am using on the same page creates this issue, how can the shortcode affect other blocks?
Regards
CarstenHi Carsten,
Thank you for reporting.I am not sure how a shortcode can affect the block. will need time to test today before replying again.
Regards
BrajeshHi Brajesh, I appreciate that, I’ve got this answer from my theme developer, to whom I addressed the issue first.
‘If it always appears before the content wherever you place it – then it’s the way Shortcode is returning its content. Which would have to be fixed at the source’
Regards
CarstenUntil then I’m testing the Custom listing of Recent Visitors code snippet, but I’m not getting any output from it. Can you confirm that it’s still supposed to work?
Thanks
/* custom Recent visitor code to list it anywhere for logged in user */ $visitors = visitors_get_recent_visitors(get_current_user_id(), 5);//pass the user id for which we are retriving and how many we want foreach( (array) $visitors as $visitor_id ){ echo bp_core_get_userlink( $visitor_id );//display the name of the //bp_core_get_user_displayname( $visitor_id ); //use it to fetch the user display name //bp_core_get_user_domain( $visitor_id ); //use it to get user profile url //bp_core_fetch_avatar( array('item_id'=> $visitor_id, 'height'=>25, 'width'=> 25)); //fetch user avatar }
Hi Carsten,
1. Your subscription expired on 24th June. Currently, we list it on the subscription page and not on plugins page. We will update this weekend to show it over the plugin page too.2. The above code will work if you put it in template file. If you put it in bp-custom or functions.php, It won’t.
3. If you want, I will be glad to share the updated copy via google drive as it was a bugfix.
Thank you
Brajesh
The topic ‘ [Resolved] Recent Visitors shortcode creating issues in Blocks’ is closed to new replies.