- This topic has 22 replies, 2 voices, and was last updated 3 years, 6 months ago by Elvin.
-
AuthorPosts
-
August 26, 2016 at 3:08 pm #221550Bill
Ok, I am still confused. I have both a post image and a featured image in each post.
I need the featured image for the Recent Posts Widget Extended plugin.
In order to not show both post image and featured image on a single post page, I use this css:
.page-header-image-single {
display: none;
}I see that the image still loads but is just hidden? Won’t that affect load time?
So, from what I am understanding, I should go ahead and just remove all of the post images so they use just the Featured image and use this css
.page-header-image-single {
text-align: center;
}to center the Featured image in the single post?
Thanks!
August 27, 2016 at 12:06 am #221602TomLead DeveloperLead DeveloperHi Bill,
Both shouldn’t display.
If the Page Header metabox has an image set, it will display that image.
If not, it will display the featured image if it’s set.
From the sounds of it, you would be better off just using the Featured Image metabox if you’re not using any of the more advanced settings of the Page Header metabox ๐
August 28, 2016 at 2:06 pm #221947BillHi Tom.
I am still having trouble with this.
When I look at my blog page, both post image and feature image show unless I select “Hide” under the “Post Image” in the Customizer. Then just the post image shows and not the featured image. This part works great.
When I look at a single post page, however, both the image within the post and featured image are showing. So, do I have to go into every post page and disable the “post image/page header” to keep the featured image from showing? Or hide them with css?
I don’t want to use the featured image because it does not display the caption.
I guess I am looking for a “Hide featured Image” by default button or something similar in the customizer.
Thanks again!
August 28, 2016 at 7:00 pm #221986TomLead DeveloperLead DeveloperAh I understand, you’re using the same image inside the content and as your featured image.
Using display: none is the easy solution – I don’t think having elements hidden affects load time, but I can’t tell you for sure.
You might be able to use a function like this:
add_action( 'after_setup_theme','generate_remove_single_featured_images' ); function generate_remove_single_featured_images() { remove_action('generate_before_content','generate_featured_page_header_inside_single', 10); remove_action('generate_before_content','generate_page_header_single', 10); remove_action('generate_after_entry_header','generate_page_header_single_below_title', 10); remove_action('generate_after_header','generate_page_header_single_above', 10); }
August 28, 2016 at 9:35 pm #222012BillThanks Tom!
That worked perfectly! I put it in child’s functions.php.
The Recent Posts Extended plugin was also able to pull in the featured images for the thumbnails.
All is well!
August 29, 2016 at 12:04 am #222031TomLead DeveloperLead DeveloperAwesome, glad I could help ๐
September 28, 2020 at 4:01 pm #1462932impro1Hi Tom, is this feature implemented in GP premium?
I want to hide the featured image in a single post page.September 28, 2020 at 4:23 pm #1462944ElvinStaffCustomer SupportHi Gautam,
Hi Tom, is this feature implemented in GP premium?
I want to hide the featured image in a single post page.Yes this is a feature implemented in GP Premium.
https://docs.generatepress.com/article/adjusting-the-featured-images/Feel free to open a new topic for further questions. Thanks.
-
AuthorPosts
- You must be logged in to reply to this topic.