Site logo

Archived topic

Read More not displaying after writing Excerpt.

32 replies · Started by Jesus Higuerey on July 24, 2018

Viewing posts 16–30 of 33

Hello there, I've added text to the post, deleted the excerpt and now it seems to be working.

So just to be clear, if I write an excerpt the read more button won't appear?

Well the button is there is just if I write the excerpt it doesn't appear which makes no sense to me atm

When you use the custom excerpt metabox, WordPress assumes that you want the full excerpt to show - hence there isn't the read more link.

The article I linked will force read more to show even if you are using custom excerpt.

Take a look at the first 2 sentences on that article.

Well it doesn't seem to work then.. I have the code in a snippet since the beginning though ...

With that post custom excerpt is not enabled .. It is what I'm trying to say, if I add custom excerpt the button goes away. And yes I have the code you mentioned, I can give you an username and password if you would like to take a look :)

Yeah in the video it was enabled. But you said that even if I have an custom excerpt it should show the button which it doesn't

Yeah like I said before, I have the code you mentioned, but I want to be able to create a custom excerpt without the button disappearing.. which is what's happening right now .. Custom excerpt = button disappears, having the code you mentioned.

Can you write a custom excerpt again?

Please check, my excerpt is currently at 20 words, which it now clearly more than that..

Right so now the only problem is that it's a read more link and not a read more button?
https://www.screencast.com/t/gA8JqJEtLX

Can you copy and paste you are using here? be sure to highlight the code and click <code>

It doesn't really matter tbh I actually prefer the link instead of the button, rather fix why the excerpt is so long, it should've stopped at 20 words.

add_filter( 'wp_trim_excerpt', 'tu_excerpt_metabox_more' );
function tu_excerpt_metabox_more( $excerpt ) {
	$output = $excerpt;
        $settings = wp_parse_args( 
		get_option( 'generate_blog_settings', array() ), 
		generate_blog_get_defaults() 
	);
	
	if ( has_excerpt() ) {
		$output = sprintf( '%1$s <a href="%2$s">%3$s</a>',
			$excerpt,
			get_permalink(),
                        wp_kses_post( $settings['read_more'] )
		);
	}
	
	return $output;
}
This archived topic is closed to new replies.