WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to exclued or display a single category (3 posts)

  1. Nos402
    Member
    Posted 4 years ago #

    on heathallyn.com I want my main blog to display everything EXCEPT posts in the "haiku" category. Then in the upper right hand corner DIV, I want to display only the latest single post from the "haiku" category.

    Having just migrated from MT, this is a whole new and foreign world. Any help is appreciated.

  2. Nos402
    Member
    Posted 4 years ago #

    To be more specific, I would like the "Haiku" DIV to show the title, and full entry.

    Currently by using:

    <?php $recent = new WP_Query("cat=11&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
    <a href="<?php the_permalink() ?>" rel="bookmark">
    <?php the_title(); ?>
    <?php endwhile; ?

    I have it displaying a link to the latest entry so I'm close.

  3. Nos402
    Member
    Posted 4 years ago #

    Figured it out! Here's my Haiku DIV;

    <div id="haiku">
    <?php $recent = new WP_Query("cat=11&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
    <h4>Haiku: <?php the_title(); ?></h4>
    <?php the_content(); ?>
    <?php endwhile; ?>
    </div>

    Anyone see any problems that might cause? It seems to work as desired!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags