• Resolved raptrex

    (@raptrex)


    So I have this code that does not display posts from this category in my index
    <?php if (in_category('4')) continue; ?>

    However, it still counts the post it skips, so say I want to display 10 posts and a post made in category 4 was just created, the loop would only display 9 posts

    Anyone know how to fix this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter raptrex

    (@raptrex)

    bumb, I still have not figured this out

    Thread Starter raptrex

    (@raptrex)

    okay this shows 10 posts from all categories but category 4, however, now pagination does not work

    <?php query_posts('cat=-4&posts_per_page=10'); ?>
    		<?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
    		<?php /** change '4' to the category number of your Article/blog section */ ?>
    
    		<?php /** this gets the url from the custom field called 'url' */ ?>
    		<?php $url = get_post_meta($post->ID, 'url', true); ?>
    			<li>
    				<a href="<?php echo $url; ?>" rel="bookmark" target="_blank" title="<?php the_title(); ?>">
    				<?php echo get_post_image (get_the_id(), '', '', '' .get_bloginfo('template_url') .'/scripts/timthumb.php?zc=1&w=150&h=150&src='); ?></a>
    				<h3><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    			</li>	
    
    		<?php endwhile; ?>
    		<?php else : ?>

    Thread Starter raptrex

    (@raptrex)

    haha i fixed it
    <?php query_posts($query_string . "&cat=-4"); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Ignoring 1 category in the loop, but reading settings counts the post’ is closed to new replies.