[Resolved] Featured image parameter

Home Forums Support [Resolved] Featured image parameter

Home Forums Support Featured image parameter

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #2074196
    David
    Staff
    Customer Support

    Yeah the GP Blog Featured Image options only apply when the theme outputs the image. Your function is using get_the_post_thumbnail

    https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/

    On this line of the code:

    $feat_img = get_the_post_thumbnail($post->ID, 'post-single');

    If you just want to display a different size image, you can change the post-single to a different attachment size.

    If its something more than that, let me know.

    #2074389
    Charles

    OK, this makes sense.

    WP is creating a shit-ton of images on each upload:

    https://drive.google.com/file/d/15HBafGSnIjRkNCgPK0HQH6bpRSYztAa7/view?usp=sharing

    Can/should I try to prevent that? And how do I know which image is which registered image size name?

    Thanks

    #2074390
    Charles

    Also which image size name does GP use for the featured image?

    #2074425
    David
    Staff
    Customer Support

    You may have some other plugins or functions that are adding more attachment sizes. By default the sizes with their names are:

    150px* thumbnail
    300px* medium
    768px medium_large
    1024px* large

    There are other larger sizes but WP will only generate those if the original image is real big.
    The ones marked with the * are those listed in the Settings > Media

    By default GP will use the Full Size image BUT WP will output the src-set sizes available, so the browser can select one.
    In the Blog settings you can select a specific Media Attachment size for GP to load as well as specifying specific width / height attributes.

    What settings did you add to the Blog settings exactly ?

    #2074471
    Charles

    I only added “full” as the media attachment size. Is full the same as large?

    In this code I don’t see how ‘post-single’ maps onto the image size names (is ‘post-single’ an image size name?):

    $feat_img = get_the_post_thumbnail($post->ID, ‘post-single’);

    Would this be right?

    $feat_img = get_the_post_thumbnail($post->ID, ‘large’);

    #2074728
    Elvin
    Staff
    Customer Support

    Hi Charles,

    In this code I don’t see how ‘post-single’ maps onto the image size names (is ‘post-single’ an image size name?):

    Assuming you’ve registered an image size named post-single then yes, it should be an image size. But if you didn’t it’s probably a non-existing image size and won’t work.

    I only added “full” as the media attachment size. Is full the same as large?

    It can’t be but not all the time. full is the size of the innate size of the image file when you’ve uploaded it.
    large is a scaled version of the file for the large media size specified in Admin > Settings > Media as shown here – https://share.getcloudapp.com/5zunyOeo – which by default, is set to 1024×1024.

    $feat_img = get_the_post_thumbnail($post->ID, ‘large’);

    Yes, that’s how you change the size it will use. 😀

    #2074733
    Charles

    Thank you.

    #2074747
    Elvin
    Staff
    Customer Support

    No problem.

Viewing 8 posts - 16 through 23 (of 23 total)
  • You must be logged in to reply to this topic.