WordPress.org

Ready to get started?Download WordPress

Forums

Posting Multiple Categories on the Index page (1 post)

  1. mrlaporte
    Member
    Posted 1 year ago #

    Is there a way to multiple this down a list, keeping out certain categories. We only want a News, Features, Opinion and A&E. And of course under each of these posts we only want posts from this category, how is this possible?

    <?php if ( $paged > 1 || option::get('recent_posts') == 'on') { ?>
    <div id="content">
    <h3 class="title"><?php echo $paged < 2 ? __('News', 'wpzoom') : __('Archives', 'wpzoom'); ?><?php if ( $paged < 2 ) _e; ?></h3>

    <div class="clear"></div>
    <?php
    global $query_string; // required

    /* Exclude categories from Recent Posts */
    if (option::get('recent_part_exclude') != 'off') {
    if (count(option::get('recent_part_exclude'))){
    $exclude_cats = implode(",-",option::get('recent_part_exclude'));
    $exclude_cats = '-' . $exclude_cats;
    $args['cat'] = $exclude_cats;
    }
    }
    /* Exclude featured posts from Recent Posts */
    if (option::get('hide_featured') == 'on') {
    $featured_posts = new WP_Query(
    array(
    'post__not_in' => get_option( 'sticky_posts' ),
    'posts_per_page' => 5,
    'meta_key' => 'wpzoom_is_featured',
    'meta_value' => 1
    )
    );

    $postIDs = array();
    while ($featured_posts->have_posts()) {
    $featured_posts->the_post();
    global $post;
    $postIDs[] = $post->ID;
    }
    $args['post__not_in'] = $postIDs;
    }

    $args['paged'] = $paged;
    if (count($args) >= 1) {
    query_posts($args);
    }
    ?>

    <?php get_template_part('loop'); ?>

    </div> <!-- /#content -->

    Is there a way to duplicate this and specify it?

Topic Closed

This topic has been closed to new replies.

About this Topic