- This topic has 22 replies, 4 voices, and was last updated 2 years, 3 months ago by Elvin.
-
AuthorPosts
-
January 9, 2022 at 7:19 am #2074196DavidStaffCustomer 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.
January 9, 2022 at 8:00 am #2074389CharlesOK, 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
January 9, 2022 at 8:01 am #2074390CharlesAlso which image size name does GP use for the featured image?
January 9, 2022 at 8:38 am #2074425DavidStaffCustomer SupportYou 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
768pxmedium_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 > MediaBy 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 ?
January 9, 2022 at 9:41 am #2074471CharlesI 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’);
January 9, 2022 at 4:41 pm #2074728ElvinStaffCustomer SupportHi 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 thelarge
media size specified inAdmin > 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. 😀
January 9, 2022 at 4:47 pm #2074733CharlesThank you.
January 9, 2022 at 5:06 pm #2074747ElvinStaffCustomer SupportNo problem.
-
AuthorPosts
- You must be logged in to reply to this topic.