Silder in Category

Viewing 2 posts - 1 through 2 (of 2 total)
  • #16340
    baka
    Participant

    Hi there,
    is it possible, to not only show the slider on the frontpage but also within the categories? The slider inside category view should show the sticky post of that cat.
    I would really appreciate any help on this matter.
    Thanks!
    Michael

    #16364
    Daniel Tara
    Keymaster

    Open slider.php and replace this line:

    <?php $slider = new WP_Query( array( 'post__in' => $sticky, 'ignore_sticky_posts' => 1, 'posts_per_page' => 99 ) ); ?>

    with something like this:

    <?php
    $args = array( 'post__in' => $sticky, 'ignore_sticky_posts' => 1, 'posts_per_page' => 99 );
    if( is_category() )
        $args['cat'] = get_query_var( 'cat' );
    $slider = new WP_Query( $args );
    ?>
Viewing 2 posts - 1 through 2 (of 2 total)

Tagged: ,

You must be logged in to reply to this topic.