Read More and Excerpt (Random Display)

I have just three posts in this Development site under the category ‘Bob’s Blog’. I have a blog index page for this category. The ‘automatic’ read more link is only displaying on one post and the auto excerpt is only showing on two…can you help me understand why thisi s happening please.

Hi There,

Thank you for writing in, but I can not access your login page. Please confirm.

Cheers!

I have amended the Dashboard URL - my mistake sorry

Hi there,

The fact that the Pro Editor may have different elements at the beginning of the blog and that is pulled the first 55 characters may cause different cases as yours.

I suggest that you use the excerpt box which you can decide what to add to the blog posts. I enabled that for you by going to one of the posts and clicking the screen options at the top and enabling the Excerpt:

Now you have an option there to add your desired excerpt:

Thank you.

Hi Christopher

The whole point is this should be automatic shouldn’t it? - I don’t want my client to have to take ANOTHER step when posting. This is a Wordpress core function is it not. I am confused as to why one works whilst the other do not.

And you have not mentioned the READ MORE Text link problem.

Cheers

John

Hi there,

There are things that Wordpress can’t do which is why they provided a way to manually add the excerpt. It’s not our restriction. Please note that Wordpress will remove HTML and shortcodes from the content to generate plain text excerpt, thus, removing the codes added by the builder. Posts are mostly for blogging and creating it through a builder is not recommended, it’s the same issue if you use Visual Composer. Hence, builders work best in pages where there are no excerpts.

And Wordpress will remove the shortcodes from it. Hence, the result could vary, it could be empty if the content is mostly shortcodes, or small text if the text contains a bit of text outside the shortcodes.

Example,

[button]hello[/button]text

If Wordpress generate a plain text from it, it will remove the block [button]hello[/button], hence, the excerpt will be text. But what if it’s like [button]hello text[/button], then excerpt will be empty.

Read more is only applicable for excerpt generated by Wordpress or by using <!--more-->, but you can add Read more manually by forcing it through custom code. Please check this https://www.geekwire.com/devblog/controlling-wordpress-excerpts-generating-read-links/. Our theme follows Wordpress standard, that customization should work.

If you wish to make this all automatic then you will need to create or override the Wordpress’s current excerpt system. Like, use cURL to download the finished page and pick some strings in it using PHP DOM parser, it’s possible. But just to generate a few text, you will have to sacrifice the performance of your site.

Thanks!

OK…to finish with this.
I have tried various combinations

If you use Cornerstone/Pro to produce/edit a blog the excerpt will NOT show automatically and NO READ MORE link is there

If you use the WP editor the excerpt WILL display WITH the READ MORE text

If you over-ride the auto excerpt by adding your required excertp to the ‘excerpt field’ of the WP Editor, then that excerpt DOES displays but the READ MORE text DOES NOT.

All a bit messy to be honest!

Hi there,

In that case, you can manually add the text excerpt, and have this code added to your child theme’s functions.php

function x_manual_excerpt_more( $excerpt ) {
	$excerpt_more = '';
	if( has_excerpt() ) {
    	$excerpt_more = '&nbsp;<a href="' . get_permalink() . '" rel="nofollow">Read more</a>';
	}
	return $excerpt . $excerpt_more;
}
add_filter( 'get_the_excerpt', 'x_manual_excerpt_more' );

Wordpress will not add read more to custom excerpt, but you can enforce it with that code.

Hope this helps.

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