• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 495
  • Last Modified:

Wordpress Excerpt


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

1 Solution
Ray PaseurCommented:
good example of the problem would be one the following link...

What link, please?
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.

Andy6350Author Commented:
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=http://local-estateagent.co.uk/wp-content/themes/localestateagent/images/header-search-img.jpg width="920" height="314">

Open in new window

and should be this:

<img src="http://local-estateagent.co.uk/wp-content/themes/localestateagent/images/header-search-img.jpg" 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

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

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now