Forums

[resolved] categories have posts mixed in from other categories (2 posts)

  1. hunts57
    Member
    Posted 1 year ago #

    I installed wordpress a week ago and then updated to 3.1 yesterday. I've now started adding content. However, my categories show all content from other categories.

    Cooking schools (parent)
    abruzzo (child of Cooking schools)
    Emilia-Romagna (child of Cooking schools)

    I have one post in Abruzzo and 2 in Emilia-Romagna however when I click on the categories I see all three! :(

    http://www.cookinginitaly.net

    maybe I've done something wrong in in archive.php

    <?php query_posts('orderby=rand'); ?>
    
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<h1 class="single"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>  
    
    	 <div id="archive">
    	<a href="<?php the_permalink() ?>" rel="bookmark" title="Go to <?php the_title(); ?>">
        <?php the_post_thumbnail(); ?></a>
    	<?php the_excerpt(__('Read more'));?></div>
  2. hunts57
    Member
    Posted 1 year ago #

    I found the solution. It was the first line in the query

    <?php query_posts('orderby=rand'); ?>

    I changed it to

    <?php query_posts($query_string . '&orderby=rand'); ?>

    which seems to have resolved the problem.

Topic Closed

This topic has been closed to new replies.

About this Topic