Sounds like there is a problem in your custom template file itself. If you dropped a copy of the file into the WordPress pastebin and posted the pastebin url here, someone might be able to spot the problem and suggest a solution.
Cheers for the reply. The pastebin url is located here: http://wordpress.pastebin.com/51ny2Cyt
So basically what I have done is that WordPress Page with that custom template attached calls for a category with specific wordpress posts in it. But yes, the only problem I am encountering is the fact when you click on one of the posts, it should only show that post’s content only, but it doesn;t.
What link are you using to get to the single post? Your post titles aren’t links. any chance of a link to a page using this template?
Oh I’m sorry, but this is what I had previously to control the problem:
<?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
Why aren’t you using that in your custom template?
This is what happens if I implement it: link
I’ve tried to implement that (I quickly had to revert because it didn’t work). Selecting a single post still spits out multiple duplicates.
I quickly had to revert because it didn’t work
What happened? The problem might in another template – header.php, for example
The display of the page was fine but if you a link the post title and select it to view that post only, it still duplicates that post down the page, instead of showing just that one post.
In that case, it sounds like the issue is in your single.php template file.
I would appreciate for further help. This is my single.php file:
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<div style="float:right; color: #242424; font-weight:bold; font-size: 12px; text-transform: uppercase; font-family: 'Courier New', sans-serif;"><?php
$category = get_the_category();
echo $category[0]->cat_name;
?></div>
<div class="entry">
<a class="posttitlelink" href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a><br />
<?php echo get_post_meta($post->ID, 'Photography by', true); ?>
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<span class="date"><?php the_date(); ?></span>
</div>
</div>
<?php if(is_single()) { // single-view navigation ?>
<?php $posts = query_posts($query_string); if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php previous_post_link(); ?> | <?php next_post_link(); ?>
<?php endwhile; endif; ?>
<?php } else { // archive view navigation ?>
<?php posts_nav_link(); ?>
<?php } ?>
<?php endwhile; ?>
<?php else: ?>
<h2 class="posttitle center">Not found.</h2>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<div style="clear:both;"></div>
<?php get_footer(); ?>
Is it clashing with the way I have set up the template page?
You got 2 loops in that template file!
Try replacing:
<?php if(is_single()) { // single-view navigation ?>
<?php $posts = query_posts($query_string); if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php previous_post_link(); ?> | <?php next_post_link(); ?>
<?php endwhile; endif; ?>
<?php } else { // archive view navigation ?>
<?php posts_nav_link(); ?>
<?php } ?>
with:
<?php previous_post_link(); ?> | <?php next_post_link(); ?>