• Hi,

    i have a theme with a slider (example).

    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.