Support » Fixing WordPress » Theme does not include a category template

  • Resolved erinfriction


    The template that I desire to use does not include a category template. I’ve duplicated the archive.php file and renamed it to category.php, but obviously all that gets me is a list of posts. I’d like it to look like you would expect, with full posts (or excerpts) of each post. I’m crap with php and could use help in figuring out what I need to change.

    This is the present content of the file:

    <?php get_header(); ?>
    <div class="colmask rightmenu blogstyle">
      <div class="colmid">
        <div class="colleft">
          <div class="col1">
              <?php _e('Archives', 'r755'); ?>
              <?php wp_title('',true,'right'); ?>
            <br />
            <!-- Put Archive Dates in a Drop Down -->
            <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
              <option value=""><?php echo attribute_escape(__('Select Month', 'r755')); ?></option>
              <?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?>
            <!-- Put Categories in a Drop Down -->
            <?php wp_dropdown_categories(__('orderby=name&show_count=1&show_option_none=Select Category', 'r755')); ?>
            <script type="text/javascript">
      var dropdown = document.getElementById("cat");
      function onCatChange() {
    	if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
    		location.href =
    		"<?php echo get_option('home');?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
        dropdown.onchange = onCatChange;
            <!-- Put A Link To Archive Index Page -->
            <a href="<?php bloginfo('url'); ?>/archives">
            <?php _e('Browse All', 'r755'); ?>
            <!-- The Loop -->
            <?php if (have_posts()) : ?>
              <?php while (have_posts()) : the_post(); ?>
              <li><a href="<?php the_permalink(); ?>">
                <?php the_title(); ?>
                </a> <span>(<em>
                <?php the_time('F j, Y') ?>
                <?php comment_type_count('comment'); ?>
                <?php _e('comment/s', 'r755'); ?>
              <?php endwhile; ?>
            <?php endif; ?>
            <?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>
          <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Any help is appreciated!

Viewing 1 replies (of 1 total)
  • It looks like your archive.php doesn’t actually show posts (only titles). So once you copied it, you would go to the loop (look for this code):

    <?php while ( have_posts() ) : the_post(); ?>

    and inside it, below the_title(), you would add,

    <?php the_content('Read more...'); ?>

    At that point, the template should show excerpts or posts (depending on what you selected in the settings).

    Also, if you name the file category-1 or category-2, you can make these category-specific and put text about the start of the loop, and the template will be used only for that category.

Viewing 1 replies (of 1 total)
  • The topic ‘Theme does not include a category template’ is closed to new replies.