Home › Forums › Calendar Products › Events Calendar PRO › Shortcode [tribe_events] not working – other shortcodes do work.
- This topic has 4 replies, 2 voices, and was last updated 8 years, 8 months ago by
Amy Doughten.
-
AuthorPosts
-
July 30, 2017 at 3:57 pm #1328163
Amy Doughten
ParticipantHello! I am using Events Calendar + Events Calendar Pro.
Environment = GeneratePress and Elementor as a pagebuilder.The pagebuilder has the ability to add shortcodes. When I add [tribe_mini_calendar], the calendar displays both in preview and “live.” It also works with [tribe_this_week]. However, when I use [tribe_events] it only shows in preview mode, not “live.” (https://www.whatsupucity.com/calendar/) **all 3 shortcodes are there, only two display*
The shortcode [tribe_events] does on on a wordpress page that is not using the pagebuilder. (https://www.whatsupucity.com/test/)
Any ideas? I’m at a complete loss. The calendar itself also displays as expected, but without the pageheader I’ve created on the interior pages and my .php skills are non existent, although I’m sure there’s a way to fix it that way (https://www.whatsupucity.com/events/)
Thank you in advance.
August 1, 2017 at 7:28 am #1328748Amy Doughten
ParticipantNot sure what the proper procedure is here – bumping this up for response. Thanks in advance.
August 1, 2017 at 8:18 am #1328768Barry
MemberHi Amy,
I’m really sorry you were kept waiting so long – but would love to help if I can. Some code like this should help:
function reregister_tribe_events_shortcode( $atts ) { $shortcode = new Tribe__Events__Pro__Shortcodes__Tribe_Events( $atts ); return $shortcode->output(); } add_action( 'init', 'reregister_tribe_events_shortcode', 100 );This could be added either to a custom plugin (preferred) or else to your theme’s functions.php file.
The problem it solves is that – by design – the [tribe_events] shortcode will only render once per page. Behind the scenes, though, we find that a lot of page builders effectively trigger the display of shortcodes and other things more than once (though the output is only used once), which can cause problems.
I wanted to flag that because this code will also let you use [tribe_events] multiple times on the same page, however it is not designed for that and doing so may cause problems (in other words, use this solution with care!).
August 23, 2017 at 9:35 am #1339138Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Shortcode [tribe_events] not working – other shortcodes do work.’ is closed to new replies.
