Wordpress Excerpt

Posted on 2011-10-25
Last Modified: 2012-05-12

I have modified the loop file for a clients website that i created, but for some reason on some posts i get multiple excerpt more links and on others they appear fine. Not sure whats going on. I have attached my function.php file and my loop.php file.

I good example of the problem would be one the following link, see how on some properties i get one read more link and on others i get two.

Hope you can help

Question by:Andy6350
    LVL 107

    Expert Comment

    by:Ray Paseur
    good example of the problem would be one the following link...

    What link, please?
    LVL 23

    Expert Comment

    Possibly a misplaced div tag? It's hard to tell with the code you have given. I'm not sure what template file your using to display the loop in question. You could try using W3C Validator to check for mismatched div tags. If you have a div after an endif statement that has been a cause of similar issues for me.

    Author Comment

    LVL 23

    Expert Comment

    OK you probably have the_content("Read More"); in the loop and then you have a template tag that is calling the_excerpt(); which also adds the read more... link.

    Another possibility could be your image tags aren't closing correctly. The output is this:
    <img src= width="920" height="314">

    Open in new window

    and should be this:

    <img src="" width="920" height="314" />

    Open in new window

    If they are dynamic images being called using PHP it would be one of these two, or something similar:

    <img src="<?php bloginfo('template_url'); ?>/images/yourimage.jpg" />

    Open in new window

    or if it's a featured image it would be something like this:
    <a href="<?php the_permalink(); ?>" title="<?php the_title();?>">
      <?php the_post_thumbnail(); ?>

    Open in new window

    LVL 31

    Accepted Solution

    I think the problem is that in some posts you've actually included an excerpt and in some posts you left it blank.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Do you think that WordPress is just for blogs?  Think again!  WordPress is really a fantastic all around platform that you can use to develop websites on.  Integrated into its basic functionality is the ability to create pages using your choice of a…
    So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
    The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
    The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now