raptrex
Member
Posted 2 years ago #
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?
raptrex
Member
Posted 2 years ago #
bumb, I still have not figured this out
raptrex
Member
Posted 2 years ago #
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 : ?>
raptrex
Member
Posted 2 years ago #
haha i fixed it
<?php query_posts($query_string . "&cat=-4"); ?>