Forums

Category templates: Error in my php and I can't find it. (1 post)

  1. rockn4him
    Member
    Posted 2 years ago #

    I have a category.php to load different template files base on the category. Since I made this change I encounter an error. The page displays the header ---> content ---> footer like it should, but then at the end of the page after the footer it repeats the content (posts). I know this is an error in my php (specifically the 1st 12 lines) and I can't seem to fix it. Sure it's something simple, I'm just novice. Here's the code for category.php

    <?php
    if (is_category(array('58','62','44','48','50','46','41','54','52','56','60','63'))) {
    	include ('unknown_case.php');
    	return;}
    elseif (is_category(array('9','57','61','43','47','49','45','40','53','51','55','59'))) {
    	include ('known_case.php');
    	return;}
    else { ?>
    	<?php include ('archive.php');?>
    <?php } ?>
    
    <?php get_header(); ?>
    
    <div id="main">
    
    <div id="contentwrapper">
    
    <?php if (have_posts()) : ?>
    <?php // This is the code to exclude categories on the home page.
    if ( is_home() ) {
    $include_cats = '+4'; // excludes uncategoried, blogroll & general interest on my home page
    query_posts('cat='.$include_cats);
    }
    ?>
    
    <?php while (have_posts()) : the_post(); ?>
    
    <div class="topPost">
      <h2 class="topTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
      <div class="topContent"><?php the_content('(continue reading...)'); ?></div>
      <span class="topComments"><?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?></span>
      <span class="topTags"><?php the_tags('<em>:</em>', ', ', ''); ?></span>
      <span class="topMore"><a href="<?php the_permalink() ?>">more...</a></span>
      <div class="cleared"></div>
    </div> <!-- Closes topPost --><br />
    <hr />
    
    <?php endwhile; ?>
    
    <?php else : ?>
    
    <div class="topPost">
      <h2 class="topTitle"><a href="<?php the_permalink() ?>">Not Found</a></h2>
      <div class="topContent"><p>There is no content here yet. We're working on it. Check back later.</p></div>
    </div> <!-- Closes topPost -->
    
    <?php endif; ?>
    
    <div id="nextprevious">
    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
    <div class="cleared"></div>
    </div>
    </div> <!-- Closes contentwrapper-->
    
    <?php get_sidebar(); ?>

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic