- This topic has 6 replies, 2 voices, and was last updated 5 years, 4 months ago by
Elvin.
-
AuthorPosts
-
December 1, 2020 at 5:45 pm #1562505
Anthony
I can’t seem to get the excerpt length to be what I set it to in the Customizer > Layout > Blog settings. Not sure if something else is holding it back somewhere? I’ve shared a screenshot of my current settings and a link to my blog.
I have tried a combination of other settings and have had no luck.
Thanks
December 1, 2020 at 6:42 pm #1562569Elvin
StaffCustomer SupportHi,
Can you check this documentation if it is applicable?
https://docs.generatepress.com/article/excerpt-issues/#word-count-not-workingLet us know.
December 1, 2020 at 6:49 pm #1562576Anthony
Hey, thanks!
I’ve never used a more tag in my life haha.
I don’t use Gutenberg or Classic Editor for much. Most stuff I do on Siteorigin Pagebuilder.
Do I have to use a more tag in order for the excerpt word count to work? I swear this use to work no problem.
Thanks again!
December 1, 2020 at 6:51 pm #1562578Anthony
Will I need to use this?
https://docs.generatepress.com/article/activating-read-custom-excerpt/EDIT: This is something different maybe. Nvm
December 1, 2020 at 9:18 pm #1562738Elvin
StaffCustomer SupportWill I need to use this?
https://docs.generatepress.com/article/activating-read-custom-excerpt/This can actually give you clues.
I can’t seem to get the excerpt length to be what I set it to in the Customizer > Layout > Blog settings. Not sure if something else is holding it back somewhere? I’ve shared a screenshot of my current settings and a link to my blog.
By default, WordPress skips all of the excerpt_length and excerpt_more filters when the custom excerpt is used. This means the excerpt length and “read more” button won’t work if you’re using the excerpt metabox a.k.a. custom/manual excerpt.
To clarify: Are you using the excerpt metabox (custom/manual excerpt)?
If this is the case, you can try this PHP snippet:
add_filter( 'wp_trim_excerpt', 'tu_excerpt_metabox_more' ); function tu_excerpt_metabox_more( $excerpt ) { $output = $excerpt; if ( has_excerpt() ) { $output = sprintf( '%1$s <p class="read-more-button-container"><a class="button" href="%2$s">%3$s</a></p>', wp_trim_words( $excerpt, 2, '...' ), get_permalink(), __( 'Read more', 'generatepress' ) ); } return $output; }Change “2” in
wp_trim_words( $excerpt, 2, '...' )to the preferred excerpt length.If your post is showing full post content rather than excerpt, check this.
https://docs.generatepress.com/article/excerpt-issues/#full-post-content-displaying-while-using-excerptDecember 2, 2020 at 5:42 am #1563557Anthony
That PHP Snippet worked! Thanks!
December 2, 2020 at 4:13 pm #1564739Elvin
StaffCustomer SupportNo problem. Glad it works for you.:)
-
AuthorPosts
- You must be logged in to reply to this topic.