WordPress.org

Support

Support » How-To and Troubleshooting » Category Archives

Category Archives

  • When I click on one of my Categories, it brings up all the articles in that category. Which is what I want.

    But I’d like the list to be titles only, I have tried altering the category.php file, but I’m not sure that is it. Any help?

Viewing 6 replies - 1 through 6 (of 6 total)
  • While editing the category.php, just remove the_content() call from The_Loop.

    Love to, only it doesnt exist.

    <body id="archives">
    <div id="rap">
    	<?php get_header();?>
    	<div id="main">
    	<div id="content">
    		<?php if ($posts) { ?>
    			<h3><?php echo single_cat_title(); ?></h3>
    			<div class="post-info">Archived Posts from this Category</div>
    			<br/>
    			<?php foreach ($posts as $post) : start_wp(); ?>
    				<div class="post">
    					<?php require('post.php'); ?>
    					<?php comments_template(); // Get wp-comments.php template ?>
    				</div>
    			<?php endforeach; ?>
    			<p align="center"><?php posts_nav_link() ?></p>
    		<?php } else { ?>
    		<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    		<?php } ?>
    
    	</div>

    <?php require('post.php'); ?>

    Is your Loop in post.php?

    The loop must be in post.php, but isnt post.php what shows on the index as well? So If I change that then the title will only show on the main page.

    I think I got what I need with the loop below. Is there a way to add the
    < ul >< li > tags without getting any error on http://validator.w3.org/?

    <body id="archives">
    <div id="rap">
    	<?php get_header();?>
    	<div id="main">
    	<div id="content">
    
    <div class="page">
    <div class="page-info"><h2 class="page-title"><?php echo single_cat_title(); ?></h2></div>
    			<div class="post-info">Archived Posts from this Category</div>
    			<div class="page-content">
    
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <?php if ( is_category() ) { ?>
              <div class="">
    
     <?php } else { ?>
     <div class="">
    
     <?php } ?>
    
    <!-- Display the Title as a link to the Post's permalink. -->
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    
      </div> <!-- closes the first div box -->
    
     <!-- Stop The Loop (but note the "else:" - see next line). -->
     <?php endwhile; else: ?>
    
     <!-- The very first "if" tested to see if there were any Posts to -->
     <!-- display.  This "else" part tells what do if there weren't any. -->
     Sorry, no posts matched your criteria.
    
     <!-- REALLY stop The Loop. -->
    
     <?php endif; ?>
    
    </div>			
    
    </div>
    </div>

    Any help with this, adding < ul > and < li >?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Category Archives’ is closed to new replies.
Skip to toolbar