List Category Post Titles
-
Hi – I’m trying to list the category post titles in the sidebar of the category pages. There are a number of solutions in this forum, but none of them work when a post is in more than one category.
I’m not a coder, and this might be obvious to those who are, but help out here please.
(a) If I put the following in my sidebar, it generates a category number (a single number) which I see displayed in the sidebar when browsing through my blogs category pages –
<?php echo($cat); ?>
(b) The following displays a list the post titles from a particular category when I manually enter the category number in place of XX –
<?php query_posts('cat=XX&showposts=-1'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post">
<h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
</div>
<?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?><?php endif; ?>
How can the results of (a) be substituted into (b) in place of the XX on an automatic basis?
- The topic ‘List Category Post Titles’ is closed to new replies.