• Hello,

    In single.php I’m attempting to list random posts in the current category.

    Here’s the code:

    if (have_posts()) : while (have_posts()) : the_post(); ?>
    <!--The Post Is Here-->
    <?php endwhile;
    	$similar_posts = single_cat_title("", false);
    	query_posts( $similar_posts . '&order=ASC&posts_per_page=10' ); ?>
    	<h3>Similar Song Lyrics By This Artist:</h3>
    	<?php
    	while ( have_posts() ) : the_post();
    	echo '<li>'; ?>
    	<a href="<?php the_permalink() ?>" rel="bookmark" title="Song lyrics for <?php the_title(); ?>"><?php the_title(); ?></a>
    	<?php echo '</li>';
    	endwhile; ?><br />
    	<?php else: ?>

    For some stupid reason it’s not listing the posts from the current posts category. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Post Loop & query_posts()’ is closed to new replies.