WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] How to exclued or display a single category

[Resolved] How to exclued or display a single category

  • 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] How to exclued or display a single category’ is closed to new replies.
Skip to toolbar