remove links from slider

Hey

On my website (compaz.be) is use the slider. I just want the slider for showing photos, not for a post. So I like to remove the link, so that clicking on the photos doesn’t work (now clicking shows the post).

Is that possible?

Thanks
Brian

Add the code below to your child theme in the functions.php

// Remove links from slider
if ( ! function_exists( 'sparkling_featured_slider' ) ) :
/**
 * Featured image slider, displayed on front page for static page and blog
 */
function sparkling_featured_slider() {
  if ( is_front_page() && of_get_option( 'sparkling_slider_checkbox' ) == 1 ) {
    echo '<div class="flexslider">';
      echo '<ul class="slides">';
        $count = of_get_option( 'sparkling_slide_number' );
        $slidecat =of_get_option( 'sparkling_slide_categories' );
        $query = new WP_Query( array( 'cat' =>$slidecat,'posts_per_page' =>$count ) );
        if ($query->have_posts()) :
          while ($query->have_posts()) : $query->the_post();
          echo '<li>';
            if ( (function_exists( 'has_post_thumbnail' )) && ( has_post_thumbnail() ) ) :
              echo get_the_post_thumbnail();
            endif;
              echo '<div class="flex-caption">';
                  if ( get_the_title() != '' ) echo '<h2 class="entry-title">'. get_the_title().'</h2>';
                  if ( get_the_excerpt() != '' ) echo '<div class="excerpt">' . get_the_excerpt() .'</div>';
              echo '</div>';
              endwhile;
            endif;
          echo '</li>';
      echo '</ul>';
    echo ' </div>';
  }
}
endif;

@packerlandwebsites I hope you are well today and thanks for helping out here in this forum.

Your help here is really appreciated.

@Brian Have you tried the solution shared above?

Great, it works!

Thanks a lot

You are most welcome here :slight_smile: