Beaver Themer & The Events Calendar [tribe_events] Shortcode

The Event Calendar Pro has a [tribe_events] shortcode which is useful for embedding the calendar on page using different views (Month, week, etc). It allows you to filter the calendar using categories,tags, etc. Unfortunately, Beaver Themer’s Events Calendar module offers none of these filtering options.

The problem is that The Events Calendar’s [tribe_events] shortcode will not appear when you add it to a fresh Themer archive for The Events Calendar. It just shows up as a blank in the row.

The Events Calendar folks created this handy article titled, Using Shortcodes for Beaver Builder. In that article, they provide a snippet which they say allows you to use the [tribe_events] shortcode on more than one page. This snippet should be placed within your child theme’s functions.php file:

add_action( 'init', function() {
    add_shortcode( 'tribe_events', function( $atts ) {
        $shortcode = new Tribe__Events__Pro__Shortcodes__Tribe_Events( $atts );
        return $shortcode->output();
    } );
}, 100 );

After that, the [tribe_events] shortcode will appear in the Themer layout! At this point you can start adding different versions of the calendar with conditional logic, etc. Have fun!

Posted in

Leave a Comment

Table of Contents