Shortcode to showup only on events page

Home Forums Calendar Products Events Calendar PRO Shortcode to showup only on events page

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #825257
    Erin Slater
    Participant

    I am using a slider and would like it to only show on the main /events page. Using the before html feature doesnt work for me, because it add the slider to all events. I tried switching the template to the events page template and add my shortcode there but it still shows up all events. Can you tell me which php file contains only the main events page so I can include my code there?

    #825341
    Brian
    Keymaster

    Sure I can help you out.

    The main view is in this file:

    \the-events-calendar\views\default-template.php

    Follow our themer’s guide to move it to your theme and edit it there:

    https://theeventscalendar.com/support/documentation/events-calendar-themers-guide/

    Then use the conditionals from this page to only target the views you want the slider to appear.

    https://gist.github.com/jo-snips/2415009

    You may also need to use WordPress’s do_shortcode function for your shortcode to work.

    http://codex.wordpress.org/Function_Reference/do_shortcode

    Let me know if that works for you.

    Thanks

    #825514
    Erin Slater
    Participant

    Since I am only using 3 views I took the default template code and added this after the div id tribe=”events-pg-template”

    <?php if(tribe_is_map() || tribe_is_photo() || tribe_is_month() ):?>
    <?php echo do_shortcode(‘[fusionslider id=”” class=”” name=”event-slider”][/fusionslider]’); ?>
    <?php endif;?>

    In case anyone else needs to know.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Shortcode to showup only on events page’ is closed to new replies.