I've tried to diagnose this myself but I'm no programmer, really hopeful you guys can help me out. From the functions.php
file, I'm told the issue is in the add_filter('excerpt_more', 'new_excerpt_more');
line, but I wanted to include a larger part of the code for everyone to look at. All help is greatly appreciated!
function new_excerpt_more($more) {
global $post;
return '...<br><a href="'.get_permalink($post->ID).'">Read More <img class="read-more" src="'.get_bloginfo('template_url').'/images/read-more-arrow.jpg" alt="Read More" /></a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
// Custom excerpt length to show for like homepage small excerpts
function custom_excerpt_length($length) {
return 100;
}
add_filter('excerpt_length', 'custom_excerpt_length', 999);
Try this(added single quote to end of return statement):
function new_excerpt_more($more) {
global $post;
return '...<br><a href="'. get_permalink($post->ID) . '">Read More <img class="read-more" src="'.get_bloginfo('template_url') . '/images/read-more-arrow.jpg" alt="Read More" /></a>';
}
Do you see the wrong highlighting on StackOverflow? You didn't close your string at the line which starts with return
:
This
return '...<br><a href="'. get_permalink($post->ID) . '">Read More <img class="read-more" src="'.get_bloginfo('template_url') . '/images/read-more-arrow.jpg" alt="Read More" /></a>;
Should be this
return '...<br><a href="'. get_permalink($post->ID) . '">Read More <img class="read-more" src="'.get_bloginfo('template_url') . '/images/read-more-arrow.jpg" alt="Read More" /></a>';
The problem is in the above line with the return statement. There's an apostrophe missing at the end of the line, just before the semicolon.
That line should look like this:return '...<br><a href="'. get_permalink($post->ID) . '">Read More <img class="read-more" src="'.get_bloginfo('template_url') . '/images/read-more-arrow.jpg" alt="Read More" /></a>';