WordPress.org

Ready to get started?Download WordPress

Forums

pagenation not working when excluding category (2 posts)

  1. kristinachilds
    Member
    Posted 3 years ago #

    sorry if this question had been answered. i searched the forums and couldn't find a solution that worked with this specific problem.

    http://www.plasmodium.net/category/music/

    this category is the archive.php listing category 12 (music) minus category 8 (podcast). since podcast has it's own listing these entries are non-podcast music posts. pagenation works fine for all other categories, so this exclusion is most likely the culprit.

    exclusion code

    <?php if ( is_category('12') ) { query_posts('cat=12,-8'); } ?>

    pagenation code

    <div id="blog-list-more">
        <div class="next"><?php previous_posts_link('&nbsp;'); ?></div>
        <div class="previous"><?php next_posts_link('&nbsp;'); ?></div>
    </div>

    help is greatly appreciated.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    global $wp_query;
    query_posts(
    	array_merge(
    		array('cat' => 12, -8),
    		$wp_query->query
    	)
    );

    http://codex.wordpress.org/Function_Reference/query_posts

Topic Closed

This topic has been closed to new replies.

About this Topic