- This topic has 9 replies, 2 voices, and was last updated 4 years, 4 months ago by
Leo.
-
AuthorPosts
-
February 13, 2018 at 8:33 am #495371
Weatherly
Does anyone know how to kill the content image and caption from the excerpt, perhaps something some code for the child theme functions?
A little context:
We have imported this site from Joomla. And we WANT featured images because many articles (now posts) had none. But others have content images, the same ones as featured, and right in the excerpt.I tried this: Easy Custom Auto Excerpt plugin By tonjoo to get rid of the few content images, but sadly, it still left a giant caption in the way, as well as interfering with Generatepress Read More buttons.
So I’m back to thinking we need something in the functions but am not enough a PHP expert to know what exactly it would need. Any suggestions?
GeneratePress 2.0.2GP Premium 1.5.6February 13, 2018 at 10:55 am #495518Leo
StaffCustomer SupportHi there,
I’m not 100% clear on the question but WordPress strips all HTML in excerpt by default so your content images and styles in your posts shouldn’t show in excerpt.
If it’s showing then likely because you are using the more tag which includes everything: https://docs.generatepress.com/article/using-the-more-tag/
Let me know if this helps.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 13, 2018 at 11:30 am #495541Weatherly
๐ It is likely that tag is in there on some. Is there no way to work around it? As I said its a very big site with lots of old articles from before the import. It would be too much to get rid of them all manually. I did try and manually comment it out and it didn’t seem to help in any case.
February 13, 2018 at 2:17 pm #495655Leo
StaffCustomer SupportCan you guide me to the post you are referring to?
Most of them are featured images from what I can see.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 14, 2018 at 6:41 am #496115Weatherly
ok is there somewhere I can send the link? I don’t want to publicly link to the dev site.
February 14, 2018 at 6:43 am #496117Leo
StaffCustomer SupportI can see your site in the link provided in the original topic.
Just need to know which post you are referring to.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 14, 2018 at 7:56 am #496276Weatherly
here is the path to the page (its a bit weird still) 2017/03/23/the-original-medicinal-plant-gatherers-conservationists/
here is the category (its at the top)
category/welcome-united-plant-savers/resources/featured-conservation-articles/there are more but that is the most obvious one
February 14, 2018 at 11:21 am #496491Leo
StaffCustomer SupportDefinitely not the best way but give this CSS a shot:
.archive img.size-full:not(.wp-post-image) { display: none; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 14, 2018 at 12:56 pm #496580Weatherly
unfortunately that removes it from the post too. we only wanted gone from the category page excerpt. ๐
February 14, 2018 at 1:07 pm #496602Leo
StaffCustomer SupportEdited the code above.
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.