- This topic has 9 replies, 2 voices, and was last updated 4 months, 1 week ago by Leo.
September 17, 2020 at 7:29 am #1447128Jay
I was wondering if there’s a way to make the excerpt used in the Blog module ignore the MORE tag. I have my category archives setup with the masonry layout, and it works great if the excerpt shows x amount of characters from all posts – but some were written with the MORE tag, at which point the excerpt shows more. Here’s an example: https://www.versluis.com/tag/zbrush/
The first post in the list is much longer, and I’d love for it to shortened to 55 characters like the other posts, without having to remove the MORE tag from every post. I’d like to preserve any embedded images though.
I tried crafting a custom excerpt, but had no luck ignoring the MORE tag. Is there a built-in GeneratePress function I can use to make this happen?September 17, 2020 at 8:06 am #1447329LeoStaffCustomer Support
Hi there,September 17, 2020 at 11:46 am #1447626Jay
Hi Leo, thanks – that did indeed shorten the excerpt, however my images are also stripped out. I’m looking for a way to avoid that in the process.September 17, 2020 at 11:57 am #1447633LeoStaffCustomer SupportSeptember 17, 2020 at 1:06 pm #1447717Jay
Isn’t there a way to take the_content(), count 55 words and spit out the rest, then print that?September 17, 2020 at 1:08 pm #1447721LeoStaffCustomer SupportSeptember 17, 2020 at 1:27 pm #1447733Jay
I understand that. I’m assuming GeneratePress either serves this via the_content() or the_excerpt() functions. I’m trying to find a way to use whatever comes out of the_content(), ignoring the MORE tag, and shortening that.
Is there a filter I can use after content is presented on archive pages so I can amend it?September 17, 2020 at 1:30 pm #1447739LeoStaffCustomer Support
GP simply uses the_excerpt() from WordPress for this function:
Maybe it’s a better question for the WordPress support team?September 17, 2020 at 1:42 pm #1447750Jay
Sorry to have troubled you.September 17, 2020 at 1:46 pm #1447752LeoStaffCustomer Support
Sorry I couldn’t be more helpful.
There are 3 ways to handle the excerpt using
the_excerpt()function as far as I’m aware of:
– The default word count excerpt method in the customizer which ignores all HTML.
– The excerpt metabox which accepts HTML:
– And the more tag method.
Hope one of these would work for you.
- You must be logged in to reply to this topic.