Add shortcake to event pages

Home Forums Calendar Products Events Calendar PRO Add shortcake to event pages

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1326433
    William Lee
    Participant

    I am using default-template.php in a child theme to run some short codes on event pages. Something changed recently, though, and it’s no longer working. I’m not sure who helped me get this code, so I’ll ask here first before checking with the theme author.

    The code I’m using is this:

    <?php
    /**
     * Default Events Template
     * This file is the basic wrapper template for all the views if 'Default Events Template'
     * is selected in Events -> Settings -> Template -> Events Template.
     *
     * Override this template in your own theme by creating a file at [your-theme]/tribe-events/default-template.php
     *
     * @package TribeEventsCalendar
     *
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	die( '-1' );
    }
    
    get_header();
    ?>
    <div id="tribe-events-pg-template">
    	<?php tribe_events_before_html(); ?>
    	<?php tribe_get_view(); ?>
    	<?php tribe_events_after_html(); ?>
    	
    </div> <!-- #tribe-events-pg-template -->
    <?php
    echo do_shortcode('[et_pb_section global_module="28988"][/et_pb_section][et_pb_section global_module="28989"][/et_pb_section]');
    ?>
    <?php
    
    get_footer();

    That’s supposed to put two Divi sections at the bottom of event pages. They’re no longer showing up. Any ideas?

    #1326878
    William Lee
    Participant

    hahah! I just noticed my title autocorrected “shortcode” to “shortcake”! 🙂

    #1327125
    Cliff
    Member

    Hi, William.

    I’m glad you clarified because there actually is a Shortcake plugin that deals with shortcodes: https://wordpress.org/plugins/shortcode-ui/

    /wp-content/plugins/the-events-calendar/src/views/default-template.php is the original file. In the current version of that file, it tells you where to put your override file: [your-active-theme]/tribe-events/default-template.php

    Is this where you’ve put your file?

    #1327445
    William Lee
    Participant

    Yes, that’s where I put it.

    #1327777
    Cliff
    Member

    This template only gets called if Default Events Template is selected at wp-admin > Events > Settings > Display tab… which I think you do have selected based on your System Information Report.

    Please copy /wp-content/plugins/the-events-calendar/src/views/default-template.php from the latest version of the plugin and then replace your [your-active-theme]/tribe-events/default-template.php file with this new copy, then make an edit just to see if it takes effect.

    I tried this on my localhost site and it worked fine.

    You might need to clear your server and/or browser cache to see the effect.

    Please let me know how this goes for you.

    #1328333
    William Lee
    Participant

    Didn’t solve it. Cleared the cache on the server and the browser. Still nothing.

    #1328578
    Cliff
    Member

    In this case, I’d suggest trying to echo a different shortcode via do_shortcode… such as ‘gallery’ or a shortcode from a different plugin, not Divi.

    #1338603
    Support Droid
    Keymaster

    Hey 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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add shortcake to event pages’ is closed to new replies.