• Resolved Jamie7777

    (@jamie7777)


    Hello Im having a problem with the loop, just starting with wordpress. Basically I am trying to post the exerpt on the main news page and then post the full content when I click into the single post.

    I was trying to do this.

    if (single_post)
    post content
    else post
    the excerpt

    Here is my code below

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
     <?php if ( is_single() ) { ?>
    
                        <div class="post">
    						<?php the_content(); ?>
    					</div>
     <?php } else { ?>
    
     <?php } ?>
    
     <div class="post">
       <?php the_excerpt(); ?>
    <a href="<?php the_permalink(); ?>" title="Read the rest of <?php the_title(); ?>" class="more-link">Read more ?</a>
     </div>
    <br /><br />
    
     <?php endwhile; ?>
    
     <?php endif; ?>

    The problem that I am having is that when I click into a single post, its posts the full post (like I want it to) but then it adds in the excerpt of that post as well. Any help with this would be greatly appreciated.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘The excerpt getting posted twice – Loop problem’ is closed to new replies.