- This topic has 5 replies, 2 voices, and was last updated 1 year, 7 months ago by
Leo.
-
AuthorPosts
-
June 5, 2019 at 12:59 pm #920981
Mike
Is there a preferred way to show HTML tags in excerpts — I want links in the post content to show up in the archive page excerpts.
Using the Tasty theme, with the archive page displaying featured images, image padding removed. I tried using the More link, but then I get double images, the featured image and the first image in the post. I could turn off featured images, but I can’t see how to remove image padding from the regular image.
Thanks!
June 5, 2019 at 1:05 pm #920985Leo
StaffCustomer SupportHi there,
Using the more tag is the way to go, or you can consider using the excerpt metabox:
https://www.wpbeginner.com/glossary/excerpt/Not sure why you would need to add the image twice? Wouldn’t it work better to show the featured image in single post as well?
https://docs.generatepress.com/article/adjusting-the-featured-images/Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 5, 2019 at 2:08 pm #921023Mike
Thanks. Manual excerpts works for now, but less convenient if I have links in every post — besides having to copy-paste the content, I’d have to edit in two places.
I was thinking of more of a permanent solution, like changing what’s stripped out of excerpts as a function. I found various bits of code for that, but many of them were years old, and I wondered if you had a kinda best practices version.
I don’t use featured images in posts, in case I change themes and there’s no support for featureds in single posts. And in general, it seems safer to have everything self-contained in the post — for example, in the past, I’ve had to search and replace in image tags. Is this an unnecessary concern?
June 5, 2019 at 2:17 pm #921027Leo
StaffCustomer SupportHmm I’m not aware of a way to keep links in excerpt without using one of the two methods above unfortunately.
GP just uses the default WordPress excerpt function though:
https://developer.wordpress.org/reference/functions/the_excerpt/Maybe check with WordPress support to see if they have any recommendations?
Featured images should be quite well supported as it’s a WordPress feature again:
https://codex.wordpress.org/Post_ThumbnailsThat would be my recommendation anyways.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 6, 2019 at 5:48 pm #922178Mike
Yeah, I guess it’s more of a WordPress issue than a GP one. I’ll figure it out. Thanks!
June 6, 2019 at 6:03 pm #922181Leo
StaffCustomer SupportNo problem π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.