Support » Plugin: Carousel Slider » using shortcode in template

  • Resolved soloman981

    (@soloman981)


    Hi i was trying to use shortcode in template php file so i can get slider on my index page using this <?php echo do_shortcode('[carousel_slide id='13267']") ?>
    But its displaying messy and broken anyway to fix this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sayful Islam

    (@sayful)

    By default, Carousel slider only load scripts when it is in use. So this part is pretty tricky. You need to load scripts from your them. You can add the following filter hook to load script always (From version 1.6.3).

    add_filter('carousel_slider_load_scripts', 'carousel_slider_load_scripts');
    function carousel_slider_load_scripts( $load_scripts ) {
    	return true;
    }

    You can also add some condition to load page for specific page like is_home()

    Works!

    tantedine

    (@tantedine)

    Hey there! I want to try this. Can you tell me what I have to do with the hook? I want to use the shortcode in my template at the first side

    <div class=”in-love-slider”><h2 class=”in-love-slider”>In love with</h2>
    <?php echo do_shortcode(“[carousel_slide id=’7054′]”); ?></div>

    And what I have to do with this? add_filter(‘carousel_slider_load_scripts’, ‘carousel_slider_load_scripts’);
    function carousel_slider_load_scripts( $load_scripts ) {
    return true;
    }

    I’m sorry for my bad english….

    Plugin Author Sayful Islam

    (@sayful)

    Hello @tantedine,

    See detail on FAQ section, how to use it on template.
    —————————————————–
    How to use shortcode/slider in theme template file?
    https://wordpress.org/plugins/carousel-slider/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘using shortcode in template’ is closed to new replies.