- This topic has 9 replies, 3 voices, and was last updated 7 years, 11 months ago by Tom.
-
AuthorPosts
-
February 4, 2016 at 5:15 am #170324Achim
On http://demo.generatepress.com/2015/02/25/post-with-featured-image/ the code for the featured post image looks like this:
img width=”1920″ height=”839″ sizes=”(max-width: 1920px) 100vw, 1920px” srcset=”http://demo.generatepress.com/wp-content/uploads/2015/06/blog6-300×131.jpg 300w, http://demo.generatepress.com/wp-content/uploads/2015/06/blog6-1024×447.jpg 1024w, http://demo.generatepress.com/wp-content/uploads/2015/06/blog6.jpg 1920w” itemprop=”image” alt=”blog” class=”attachment-full size-full” src=”http://demo.generatepress.com/wp-content/uploads/2015/06/blog6.jpg” scale=”0″
which means that the largest image is been loaded to show up on the frontend at any time. What I want is to only load the medium size image to be used as post thumbnail. How do I do this?
- This topic was modified 8 years, 3 months ago by Achim.
- This topic was modified 8 years, 3 months ago by Achim.
February 4, 2016 at 5:06 pm #170501TomLead DeveloperLead DeveloperHi there,
GP just uses the default method to display featured images provided by WordPress.
This plugin may extend things a little further to your liking: https://en-ca.wordpress.org/plugins/ricg-responsive-images/
Let me know π
February 4, 2016 at 10:52 pm #170553AchimThank you.
To disable the responsive image ‘srcset’ on WordPress 4.4 This one works fine for me.
function disable_srcset( $sources ) { return false; } add_filter( 'wp_calculate_image_srcset', 'disable_srcset' );
- This reply was modified 8 years, 2 months ago by Tom.
February 4, 2016 at 10:53 pm #170556TomLead DeveloperLead DeveloperAwesome, thanks for sharing! π
May 9, 2016 at 6:18 pm #193085MatheusMan, I’m having a problem related to that on my blog. I tried with many codes but now I give up. I’ll give you an example straight from the html:
<div class="page-header-image-single grid-container grid-parent"> <img width="4436" height="2890" src="http://rediscoveringtheworld.com/wp-content/uploads/2016/05/ballestas-islands-2.jpg" alt="ballestas islands" /> </div>
I’m not using a page header. Even though, every post as the one above (http://rediscoveringtheworld.com/paracas-peru/) is loading the full resolution image of the featured image selected. I simply can’t take this part out and it’s making my site to load very slow for that as tested in a page speed site. As I can’t choose the size of the featured image when selecting it at the moment I create a post, do you have any clue?
- This reply was modified 7 years, 11 months ago by Matheus.
- This reply was modified 7 years, 11 months ago by Matheus.
- This reply was modified 7 years, 11 months ago by Matheus.
- This reply was modified 7 years, 11 months ago by Matheus.
- This reply was modified 7 years, 11 months ago by Matheus.
- This reply was modified 7 years, 11 months ago by Tom.
May 9, 2016 at 10:18 pm #193124TomLead DeveloperLead DeveloperThe Page Header add-on allows you to set a size using the crop feature.
However, you can also hide that image and add your own in your content with this CSS:
.page-header-image-single { display: none; }
Adding CSS: https://generatepress.com/knowledgebase/adding-css/
Let me know if you need more info π
May 10, 2016 at 4:15 am #193195MatheusActually, I do have Page Header add-on, but can’t seem to find this feature. My version of GP Premium is 1.2.81, because the last one won’t work with my server.
I have already tried to use this CSS code, but somehow it doesn’t seem to have any effect, as I don’t use any page header.
Just to make sure, I currently have the Post Image/Page Header disabled in each post, what I want is no to load the Featured Image at full size. When I look to the visible part of the page, I can’t see the Featured Image, but it’s loaded within the HTML.
- This reply was modified 7 years, 11 months ago by Matheus.
May 10, 2016 at 8:21 am #193257TomLead DeveloperLead DeveloperIs the Page Header add-on activated?
If so, the first screenshot on this page shows the cropping options: https://generatepress.com/knowledgebase/generate-page-header/
If you’re using the Page Header add-on and want to remove the image from the source let me know and I’ll provide some PHP.
May 10, 2016 at 3:31 pm #193325MatheusWow, how could I never noticed this Hard Crop function before, there it is my solution! Thanks a lot!
May 10, 2016 at 11:21 pm #193382TomLead DeveloperLead DeveloperYou’re welcome π
-
AuthorPosts
- You must be logged in to reply to this topic.