Exclude a catagory from the loop..
-
Here is my code.. I don’t know why it won’t exclude the catagory..
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php if ( !(in_category(’24’)) ) { ?>
<!– ##### Main Copy ##### –>
<div class=”post”>
<div class=”<?php the_author(‘firstname’); ?>”>
<div class=”posttitle” id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?> | <span class=”posttitlecomment”><img src=”https://www.chrisvschris.com/wp/wp-content/themes/gila/images/comment4.gif” border=0></img> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></span></div>
<div class=”postcatagory”>Filed In: <?php the_category(‘, ‘) ?> about <?php if (function_exists(‘time_since’)) {
echo time_since(abs(strtotime($post->post_date_gmt . ” GMT”)), time()) . ” ago”;
} else {
the_time(‘F jS, Y’);
} ?></div>
<?php the_excerpt(‘Read the rest of this entry »’); ?><span class=”more”>“><img src=”https://www.chrisvschris.com/images/design/read_more.gif” border=”0″ alt=”Read More” /></span>
<p class=”postedinfo”><img src=”https://www.chrisvschris.com/wp/wp-content/themes/gila/images/permalink2.gif” height=”11″ width=”10″ border=0></img> “>Permalink | <img src=”https://www.chrisvschris.com/wp/wp-content/themes/gila/images/author.gif” height=”9″ width=”7″ border=0></img> “><?php the_author() ?>
<!– /?php trackback_rdf(); ?> /?php include(ABSPATH . ‘wp-dropdown-comments.php’); ?> allow hide show comments –>
</div><!– post –>
<?php } ?> <!– Close the if statement. –>
- The topic ‘Exclude a catagory from the loop..’ is closed to new replies.