Support » Fixing WordPress » Duplicate titles on archive.php page!

  • Hi,

    I have a problem with my wordpress theme: everytime I click on a tag, a category, an archive etc… (archive.php), all of the posts being displayed have the same title and link to the same post. The posts are different (content) but all the post titles are the same, they are all the same as the title of the first post of each page.

    I know the problem comes from the template because when I change it, I don’t have this problem anymore. I spent a lot of time trying to figure out what the problem was by comparing with my other themes, but I s… at PHP 🙁

    Here is my archive.php page:

    <?php get_header(); ?>
    	<?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
    <?php if(function_exists('the_ratings')) { the_ratings(); } ?>  
    	  <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
     	  <?php /* If this is a category archive */ if (is_category()) { ?>
    		<h2 class="pagetitle">‘<?php single_cat_title(); ?>’ Category</h2>
     	  <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    		<h2 class="pagetitle">Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
     	  <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    		<h2 class="pagetitle"><?php the_time('F jS, Y'); ?></h2>
     	  <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    		<h2 class="pagetitle"><?php the_time('F, Y'); ?></h2>
     	  <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    		<h2 class="pagetitle"><?php the_time('Y'); ?></h2>
    	  <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    		<h2 class="pagetitle">Author Archive</h2>
     	  <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    		<h2 class="pagetitle">Blog Archives</h2>
     	  <?php } ?>
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
    				<div class="alignlefttt">Posted in <?php the_category(', ') ?>&nbsp;  by <?php the_author() ?>  <?php edit_post_link('Edit'); ?></div>
    			<div class="alignrighttt"><?php the_time('F jS, Y') ?></div>
    				<div class="entry">
    					<?php the_content('Read the rest of this entry &raquo;'); ?>
    				<p class="info"><?php comments_popup_link('No Comments &raquo;', '1 Comment &raquo;', '% Comments &raquo;'); ?>
    			<?php comments_template(); ?>
    		<?php endwhile; ?>
    <div class="alignrightttt"><?php next_posts_link('Next Products Page &raquo;') ?></div> <div class="alignleftttt"><?php previous_posts_link('&laquo; Previous Products Page') ?></div>
    	<?php else : ?>
    			<h1>Not Found</h1>
    			Sorry, but you are looking for something that isn't here.
    	<?php endif; ?>
    <BR /><BR /><center><?php adrotate_banner('3,5,6'); ?></center>
    	<?php get_sidebar(); ?>
    			<div class="clearer">&nbsp;</div>
    <?php get_footer(); ?>

    Thanks a lot for your help!

Viewing 1 replies (of 1 total)
  • Hmmm… Wierdest thing! My blog has decided to make me do some work too! I use the Thesis theme and after checking in with them it looks like our issue is database related. Err… But I’m not an expert. This is what happens to my site. I have a “0” (that’s a zero, naught as in the literal number) as a link showing up in my archives as a link to my current month. Yep. So I have disabled the damned thing! Grrrr…. Hopefully we can get some database hooking king to help us out.

Viewing 1 replies (of 1 total)
  • The topic ‘Duplicate titles on archive.php page!’ is closed to new replies.