WordPress.org

Ready to get started?Download WordPress

Forums

Attorney
slider on selected category (3 posts)

  1. oprone
    Member
    Posted 1 year ago #

    Please tell me how to restrict homepage post slider to a selected category.

    I tried <?php query_posts( 'cat=3' ); ?>.. but it did not work in
    alt_homepage_blog_slider.php

  2. seeshaughnessy
    Member
    Posted 11 months ago #

    I would love to know the answer to this as well! Oprone, did you ever find out an answer?

  3. grmbll
    Member
    Posted 8 months ago #

    Found the solution:
    in alt_homepage_blog_slider.php find

    <?php $args = array( 'posts_per_page' => 10, 'post_status' => 'publish',

    ad after:
    'cat' => '1',

    Then find:
    <?php /* Start the Loop */ ?> <?php while ( $fPosts->have_posts() ) : $fPosts->the_post(); ?>

    Replace by:
    <?php query_posts("cat=1"); while ( $fPosts->have_posts() ) : $fPosts->the_post(); ?>

    Now is category 1 the featured category for your slider.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.