select home post in current category
-
I’m using my category.php to select the post title “home” in the current category.
<?php $currentcat = the_category_ID(); $query = 'cat=' . $currentcat . '&name=home&showposts=1'; ?> <?php query_posts($query); ?> <?php while (have_posts()) : the_post(); ?> <?php the_title(); ?> <?php the_content(); ?> <?php endwhile; ?> ?>
However, this seems to select the latest post from any category titled home. Echoing $currentcat returns the correct category ID.
Any help appreciated.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘select home post in current category’ is closed to new replies.