This is my home page code
here is a feature post section,
i want to exclude post by a category ‘Collage’ in this section …
<?php
$count = 1;
if (have_posts()) : while (have_posts()) : the_post(); if($count == 1) : ?>
<div id="featurd_post">
<div class="ftrd_image">
<?php woo_get_image('image',455,245,' '.$GLOBALS['align']); ?> </div>
<div class="fix"></div>
<div class="ftrd_entry">
<h2 class="title">
<a href="<?php the_permalink() ?>" rel="bookmark" title=""><?php the_title(); ?></a>
</h2>
<p class="fetrd_entry"><?php dynamic_excerpt(400); ?></p>
<a href="#" title="" class="read_more">(<?php _e('आगे
पढे ', 'shreshthbharat'); ?>)</a>
</div></div>
<?php else : ?>
<--- Rest of post goes here --- >
<div class="box"><div class="post">
<h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="">
<?php the_title(); ?></a></h2>
To exclude a category you’ll need to modify the query that’s running. Do this using the query_posts() function: http://codex.wordpress.org/Function_Reference/query_posts
First, you’ll need to get the ID of the category you want to exclude:
Then you’ll need add the category exclusion to the query, and pass the new query to query_posts:
Put all this right at the top of the script, just before the loop.
Hope that works for you!
Try this may be work.. I didnt wrote it but found on wordpress website.
for more details you can check this link http://codex.wordpress.org/The_Loop#Exclude_Posts_From_Some_Category