Home Forums HashOne Shortcode Not Working in Slider

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1847
    Ksmith
    Participant

    Hello! First time posting on this forum!

    The shortcode on my site is working everywhere but on the slider. Is there a quick fix for this?

    Here’s the file code-

    template-parts/section-slider.php
    `<?php
    /**
    *
    * @package HashOne
    */
    ?>

    <section id=”hs-home-slider-section”>
    <div id=”hs-bx-slider”>
    <?php for ($i=1; $i < 4; $i++) {
    $hashone_slider_page_id = get_theme_mod( ‘hashone_slider_page’.$i );

    if($hashone_slider_page_id){
    $args = array(
    ‘page_id’ => absint($hashone_slider_page_id)
    );
    $query = new WP_Query($args);
    if( $query->have_posts() ):
    while($query->have_posts()) : $query->the_post();
    ?>
    <div class=”hs-slide”>
    <div class=”hs-slide-overlay”></div>

    <?php
    if(has_post_thumbnail()){
    $hashone_slider_image = wp_get_attachment_image_src(get_post_thumbnail_id(),’full’);
    echo ”;
    } ?>

    <div class=”hs-slide-caption”>
    <div class=”hs-slide-cap-title animated fadeInLeft”>
    <span><?php echo esc_html(get_the_title()); ?></span>
    </div>

    <div class=”hs-slide-cap-desc animated fadeInRight”>
    <?php echo get_the_content(); ?>
    </div>
    </div>
    </div>
    <?php
    endwhile;
    endif;
    }
    } ?>
    </div>
    </section>

    #1857
    Hash
    Keymaster

    Here is the fix. Change the below line

    to

    #1922
    Ksmith
    Participant

    Perfect! Thank you.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.