Tagged: archive, Blog, featured image
-
AuthorPosts
-
June 3, 2017 at 3:00 am #803230
Hi there,
So, right now I am doing a redesign of an old site, using the enfold theme. I have posts from the old site and posts fresh to the new site. When I add a brand new post, I create a featured image to use and it shows on the post page and the archive page. Beautiful.
However, all the older posts do not have featured images–they had the images inline in the post content. I would leave them the way they are, but the posts have no thumbnails, both in the Popular posts widget and the search. To get those, it seems I have to add featured images to the posts. But the images in these posts just look ugly as featured images. There’s a checkbox on the Edit Post page that says “Don’t display image on single post”. That works well to hide the featured image on the post page. BUT, the ugly image still shows on the Archive page.
So, my question is, is there any way to hide the featured image, on the Archive page, for specific posts? I have seen ways to remove allthe featured images, but I like them on the newer posts. It’s only for specific historical posts that I want to hide it.
Any help would be greatly appreciated.
P.S., I do know how to find the ID number of a post, if that helps.June 3, 2017 at 9:07 am #803322Hey perfectword,
May you provide to us your website that you`re mentioning in the question?
Best regards,
John TorvikJune 5, 2017 at 3:52 am #803741Our site is not yet live. I would appreciate some code, either CSS or for the functions.php. I have a child theme set up.
June 5, 2017 at 6:40 am #803772Hi,
You will have to find the post id class for each post, then you should be able to target only the archive page with CSS similar to this:
.archive .post-id .image-class { display:none; }
I’m not sure exactly what class the image is using on your archive page, but if you inspect it in your browser you should be able to find it.
Best regards,
RikardJune 5, 2017 at 7:56 am #803781Ok, that makes sense, but I’m not sure exactly how to format it to include the actual post id and image class. Like this?
.archive .post-id-2656 .wp-post-image { display:none; }
If that’s what it was supposed to look like, it doesn’t appear to be working. So maybe I did it wrong? I tried a lot of other permutations too–none worked
June 5, 2017 at 11:42 am #803822Hi,
It’s difficult for us know exactly what the structure is on your page, would you be able to publish it somewhere so that we can have closer look?
Best regards,
RikardJune 6, 2017 at 7:22 am #804349Figured it out! The “.archive” in the code you posted was messing it up. I’m just using this:
.post-2656 .big-preview.single-big { display:none; }
Thanks for the help!
June 6, 2017 at 9:45 am #804416 -
AuthorPosts
- You must be logged in to reply to this topic.