# Slider only having one categorie

**URL:** <https://colorlibsupport.com/t/slider-only-having-one-categorie/7629>\
**Category:** Sparkling\
**Created:** [June 29, 2015, 7:41am UTC](https://colorlibsupport.com/t/slider-only-having-one-categorie/7629 "2015-06-29T07:41:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akuji](https://colorlibsupport.com/letter_avatar_proxy/v4/letter/a/ecd19e/32.png) [@akuji](https://colorlibsupport.com/u/akuji)\
**Post date:** [June 29, 2015, 7:41am UTC](https://colorlibsupport.com/t/slider-only-having-one-categorie/7629/1 "2015-06-29T07:41:18Z")

</div>

Hi all,

I wanted to use the slider to show various images pointing to different parts of my website. As it seems, it can only be used to link to posts. At least, I’m only seeing the “common” category (word might be a little different, I have the german wordpress version installed), but no others. In the colorlib documentation for sparkling, it tells me to chose from a dropdown menu. So are there options missing that could help me to achieve what I want to do?

Greetings,  
akuji

---

<div class="post-metadata">

**Author:** ![movin](https://colorlibsupport.com/user_avatar/colorlibsupport.com/movin/32/10922_2.png) [@movin](https://colorlibsupport.com/u/movin)\
**Post date:** [August 9, 2015, 12:15pm UTC](https://colorlibsupport.com/t/slider-only-having-one-categorie/7629/2 "2015-08-09T12:15:04Z")

</div>

Hi Akuji,

I hope you are well today and thank you for your question.

You can use the slider to show various images pointing to different parts of your website or any other website by adding the following code in the functions.php file of your child theme

```auto
/**
 * 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();
          $slider_image_link_url = get_post_meta(get_the_ID(), 'slider_image_link_url', true);
           $slider_image_link_url = $slider_image_link_url != '' ? $slider_image_link_url : get_permalink();
          echo '<li><a href="'. $slider_image_link_url .'">';
            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 '</a></li>';
      echo '</ul>';
    echo ' </div>';
  }
}

```

And then set the slider\_image\_link\_url custom field having the page URL as shown in the attached screenshot for the posts displaying in the slider.

I have attached he child theme that contains the above change so you can just download ans use it.

Best Regards,  
[Movin](https://colorlib.com/)
