[Resolved] featured post image size

Home Forums Support [Resolved] featured post image size

Home Forums Support featured post image size

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #170324
    Achim

    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, 2 months ago by Achim.
    • This topic was modified 8 years, 2 months ago by Achim.
    #170501
    Tom
    Lead Developer
    Lead Developer

    Hi 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 πŸ™‚

    #170553
    Achim

    Thank 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.
    #170556
    Tom
    Lead Developer
    Lead Developer

    Awesome, thanks for sharing! πŸ™‚

    #193085
    Matheus

    Man, 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.
    #193124
    Tom
    Lead Developer
    Lead Developer

    The 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 πŸ™‚

    #193195
    Matheus

    Actually, 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.
    #193257
    Tom
    Lead Developer
    Lead Developer

    Is 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.

    #193325
    Matheus

    Wow, how could I never noticed this Hard Crop function before, there it is my solution! Thanks a lot!

    #193382
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.