Manual excerpt has no read more or ellipsis

Hi, when I add a manual excerpt to my posts, the “Read More” link below the excerpt disappears as well as the overflow ellipsis that was there for the automatic excerpts.

How can I get them both back when using manual excerpts? I’m using Pro.

Hi @threeoten,

Unfortunately, there is no Read More option when you use the Manual Expert mode and you need to click the title of the blog to go to the single blog post.

There is a none-standard way which is outside of our support scope and considered as customization, we will not be able to maintain the code or implement it for you.

You can add the Javascript code below to X/Pro > Theme Options > JS:

jQuery('.blog .entry-content.excerpt').each(function() {
	if (!jQuery(this).find('> div').length) {
		var theHref = jQuery(this).closest('.entry-wrap').find('.entry-header .entry-title a').attr('href');
		jQuery(this).find('> p').after('<div><a href="' + theHref + '" class="more-link">Read More</a></div>');
	}
});

Please consider that this code will not work if you have an Ajax load more feature or use the masonry layout of the blog.

Thank you.

I get an error with that code, on the 3rd line:

syntax error, unexpected 'var' (T_VAR)

Also regarding my first post, what about the overflow ellipsis? How do I get those back with a manual excerpt?

Hi @threeoten,

I tried the JS code provided by Christopher and I am not getting any errors. I also checked the console and there is not an error present. Kindly make sure to copy the correct code. If it doesn’t work in your setup, even after copying it correctly, perhaps there is another script that conflicts with the code. In that case, you will have to adjust the script provided as customization goes beyond the scope of our support.

As for the ellipsis, it’s supposed to just show up for the automatic excerpt that gets displays based on the content of your post and the excerpt length set in Theme Options > Blog but try adding this code in the Global CSS:

.entry-content.excerpt p:last-of-type:after {
    content: '...';
}

Hope this helps.

It may be because I am using Masonry layout?

What about this one? I found it on the forums here… is there any reason I should not use this:

// Manual Excerpt Read More
function manual_excerpt_more( $excerpt ) {
	$excerpt_more = '';
	if( has_excerpt() ) {
    	$excerpt_more = '<p><a href="' . get_permalink() . '" rel="nofollow" class="more-link">Read more</a>';
	}
	return $excerpt . $excerpt_more;
}
add_filter( 'get_the_excerpt', 'manual_excerpt_more' );

Also, why does it have a “nofollow”?

Hi @threeoten,

As I mentioned on my given code, this is not meant to be used in the Masonry layout. So yes that is why you had the problem with the code.

You can use the PHP code you mentioned and it is your choice. The nofollow option is used for SEO. You can learn about that here:

Thank you.

But I’m wondering why your colleague might have put the nofollow in this code to be used in this context. Is there any advantage to using a nofollow in this context?

Hello @threeoten,

Please check out this article to learn more about the use of the “nofollow” in the links.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.