Wordpress Problems

Discussion in 'Programming' started by William, Oct 25, 2008.

  1. #1
    I am trying to create a category.php page for my new wordpress layout
    having it display the latest posts in all categories first as links and then below that the content in that category. The problem is that my loop for showing the category content seems to get infected by the latest posts loop and displays new posts from all categories, not just the category I am viewing. CAn anyone seen were i have gone wrong. Code below and thanks in advance.

     <p>
    <?php query_posts('showposts=10'); ?>
    
    <ul>
      <?php while (have_posts()) : the_post(); ?>
      <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
      <?php endwhile;?>
    </ul>
                </p>
                </div>
                
        		
        
        		<div class="textbox">
       			
                
        		<?php if (have_posts()) : ?>
    
    			<?php while (have_posts()) : the_post(); ?>
            	
                
                
                <a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><h1><?php the_title(); ?></h1></a>
                <p class="small"><b>Posted by</b> <?php the_author(); ?> on <?php the_date(); ?></p>
                
                <?php edit_post_link(); ?>
                
    <?php  {
         the_content();
     } ?><br><br>
                
               
               
                
            
                
                <?php endwhile; ?>
    			<?php else : ?>
        		<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
        		<?php endif; ?>
                
               
    
            	<?php next_posts_link('&laquo; previous') ?>
                            <a href="#">top</a>
                <?php previous_posts_link('next &raquo;') ?>
        		
        		</div>
    Code (markup):

     
    William, Oct 25, 2008 IP