views:

7

answers:

0

My homepage lists all my posts in reverse chronological order in traditional blog format. I want to exclude from the homepage all posts from a certain category except for the latest post, i.e. display only the latest post from that category (along with all the other posts from the other categories) on the homepage.

I tried using the query_posts function but failed to make it work properly. Does anyone know what code I should be using?

Below is my existing code. I'm using the Skimmed Milk theme on WP3.0.

    <?php if (have_posts()) :

        skimmed_milk_nav_link(__('Later posts', 'skimmed'), '');

        while (have_posts()) : the_post();

            global $page; $page = 1; ?>


            <div class="post">
                <?php skimmed_milk_post_title('h2'); ?>

                <div class="entry">
                    <?php the_content('<span class="nowrap">' . __('Read more', 'skimmed') . ' &raquo;</span>'); ?>
                </div><!-- entry -->

                <?php skimmed_milk_post_meta(); ?>

                <!--
                <?php trackback_rdf(); ?>
                -->
            </div><!-- post -->

        <?php endwhile;


    else : // no posts

        skimmed_milk_something_not_found(__('No posts found', 'skimmed'));

    endif; // end if have posts ?>