Title: Slider change
Last modified: August 19, 2016

---

# Slider change

 *  [baszer](https://wordpress.org/support/users/baszer/)
 * (@baszer)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/slider-change/)
 * Hi,
 * i have a theme with a slider ([example](http://www.ruunerwold.nl/bas/vissen)).
 * Now there is the following code to create the slider:
 *     ```
       <?php
       $sticky = get_option('sticky_posts');
       if ( ! empty($sticky)) {
       rsort( $sticky );
       $sticky = array_slice( $sticky, 0, 5 );
       query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) ); ?>
       ```
   
 * Now all posts which are a sticky post will get in the slider. But i don’t want
   it to be sticky posts. I want it to be a category of my own choice. I made the
   following code
 *     ```
       <?php
       $sticky = get_option('default_category');
       if ( ! empty($sticky)) {
       rsort( $sticky );
       $sticky = array_slice( $sticky, 0, 5 );
       query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) ); ?>
       ```
   
 * But now all posts are posted (even when they dont have the default category).
   Does someone know how to fix it?
 * Thank you in advance.
    Bas

The topic ‘Slider change’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [baszer](https://wordpress.org/support/users/baszer/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/slider-change/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
