Site logo

[Resolved] Read More not displaying after writing Excerpt.

Home Forums Support [Resolved] Read More not displaying after writing Excerpt.

Home Forums Support Read More not displaying after writing Excerpt.

Viewing 15 posts - 16 through 30 (of 33 total)
  • Author
    Posts
  • #666306
    Jesus Higuerey

    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?

    #666308
    Leo
    Staff
    Customer Support

    It should be if you have the second block of code added:
    https://docs.generatepress.com/article/activating-read-custom-excerpt/

    #666312
    Jesus Higuerey

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

    #666314
    Leo
    Staff
    Customer Support

    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.

    #666317
    Jesus Higuerey

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

    #666320
    Leo
    Staff
    Customer Support

    I can see read more link showing here when you were using the custom excerpt so something is working:
    https://gyazo.com/6050e4798a1ae99def6bd45349cfed1c

    Are you sure you added the second block for the button and not the first block?
    https://docs.generatepress.com/article/activating-read-custom-excerpt/

    #666328
    Jesus Higuerey

    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 🙂

    #666332
    Leo
    Staff
    Customer Support

    Custom excerpt was enabled in the video (aka you were using the excerpt metabox) which is why the options aren’t working in your video and I was seeing different content in single post page:
    https://gyazo.com/6050e4798a1ae99def6bd45349cfed1c
    https://www.screencast.com/t/B6C8m84E6XiD

    #666333
    Jesus Higuerey

    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

    #666334
    Leo
    Staff
    Customer Support

    It showed the “Read More” link (by default it shouldn’t show that) which is what the first block of code does, if you add the second block of code then it should be a button:
    https://docs.generatepress.com/article/activating-read-custom-excerpt/

    #666336
    Jesus Higuerey

    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.

    #666338
    Leo
    Staff
    Customer Support

    Can you write a custom excerpt again?

    #666339
    Jesus Higuerey

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

    #666341
    Leo
    Staff
    Customer Support

    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>

    #666342
    Jesus Higuerey

    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;
    }
Viewing 15 posts - 16 through 30 (of 33 total)
  • The topic ‘Read More not displaying after writing Excerpt.’ is closed to new replies.