• Hi,

    I’m trying to sort my posts by category using a query that someone on this forum recommend for me, and which works beautifully on another wp installation, but for some reason doesn’t sort anything in my new one.

    <?php $temp = $wp_query;
    					$wp_query = null;
    					$wp_query = new WP_Query();
    					$wp_query -> query('showposts=6' . '&paged=' . $paged);
    					while ($wp_query -> have_posts()) : $wp_query -> the_post();?>
    		<div class="postWrapper">
    			<h2 class="post_title">
    				<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    			</h2>
    			<div class="post"><?php the_content(); ?></div>
    			<div class="post_meta">
    				<p>This post is in: <?php the_category(', '); ?></p>
    				<p class="tags"><?php the_tags(); ?></p>
    			</div>
    		</div>
    	<?php endwhile; ?>
    	<?php $wp_query = null; $wp_query = $temp; ?>

The topic ‘Posts won’t sort by cat… please help’ is closed to new replies.