Questions tagged [post-thumbnails]

Post Thumbnail is a theme feature introduced with Version 2.9. Thumbnail is an image that is chosen as the representative image for Posts, Pages or Custom Post Types.

Filter by
Sorted by
Tagged with
0 votes
2 answers
17 views

Regarding to the performances, should I check if a post has a thumbnail before or after checking if is the front page (or single page, etc.)?

Regarding to the performances, and the performances only (and not from the point of view of the readability of the code), is it a best practice to check if the post has a thumbnail before to check if ...
  • 95
0 votes
1 answer
31 views

the_ID & wp_get_attachment_image_src(the_ID(), "medium") blank

Using: $my_query->the_post(); $thumbnail_arr = wp_get_attachment_image_src(the_ID(), "medium"); $thumbnail = $thumbnail_arr[0]; $thumbnail is outputting a blank value. If I echo the_ID() ...
  • 1,588
0 votes
0 answers
12 views

In my wordpress admin panel Suddenly The Category, tag and featured Image Option are not showing

In my wordpress admin panel Suddenly The Category, tag and featured Image Option are not showing. I write blogs in my wordpress blogs but suddenly there are missing three options for adding The ...
0 votes
1 answer
27 views

image_size with respect to aspect ratios

I have image assets that I load externally and insert programmatically. There are 3 different asset classes: landscape, portrait, and 1:1 The default image_sizes are creating a lot of clutter that's ...
  • 130
0 votes
1 answer
21 views

Remove default Image Sizes

I'm trying to remove the default image sizes that are created given a specific image size threshold. Listed using this: get_intermediate_image_sizes() // thumbnail [1] => medium [2] => ...
  • 130
0 votes
0 answers
13 views

Question regarding the file path for media_sideload_image and wp_upload_dir()

Just need some advice on uploading images. I am using ACF / oEmbed to display a video in my blog and in the process extracts the thumbnail from Wistia which works fine. However, I need to put the ...
0 votes
0 answers
16 views

Strange image artifact on font-page thumbnail image

There is a recent post published on the front page of our website, midstory.org, titled "Toledo’s Jazz Scene Is Roaring Once Again". When viewed on a 1008p screen, there is a thin colored ...
0 votes
0 answers
14 views

Add attribute to featured image with filter (wp_get_attachment_image_attributes)

I'm trying to add the fetchpriority attribute to the featured image on my posts. I've seen several examples using the wp_get_attachment_image_attributes() filter but I can't seem to get it to work. * ...
0 votes
0 answers
11 views

How home my code doesn't display any feature image? Looping through post from a taxonomy and not getting feature images back

The only thing I am trying to do is just to display each post from Services that belongs to the taxonomy called 'national' and display its title and its featured image. So far it displays each title ...
0 votes
0 answers
21 views

How to detect if the ajax_query_attachments_args was triggered to set the featured image?

I'm trying to filter the attachments when the user tries to set a featured image for the current post, but this affects all the ajax_query_attachments_args hook requests, like the one in the upload....
0 votes
1 answer
24 views

How do you add a featured image to a page (not post)?

There's no "add featured image" in the settings section in a page I created. On the other hand, a similar blogpost I created has this setting. I went over some websites which told me that I ...
0 votes
1 answer
14 views

if custom field doesn't exist, use post thumbnail instead, as image background

I am trying to modify a code in my theme, but I only partially succeed. I need a working condition, if a custom field is not present, to use the post thumbnail instead, as the background image. if the ...
  • 167
0 votes
1 answer
29 views

WP Still Generating 150x150 Thumbnail Size Even After Un-Setting Small Size in Functions.php

I am using following code to prevent WordPress from creating some un required image sizes for my theme and only upload the original size add_filter( 'intermediate_image_sizes_advanced', '...
  • 193
0 votes
0 answers
36 views

How do I remove lazyloading on the mh-spotlight-widget

What is the easiest way to disable native lazy load without a plugin for a specific widget in WordPress? I can't find anything at all about this question that I could use for functions.php? // XX = ...
0 votes
1 answer
22 views

custom image size not being displayed in loop

I believe I'm missing something on media images. I have created a custom image size with this code: add_image_size( '250-square', 250, 250, true); // cropped I have then uploaded images. When I ...
  • 5,467
0 votes
0 answers
15 views

First Image not loading on Mobile Version of Website

I'm helping a friend with their website and I have came across a weird error. When the website is loaded on a mobile phone, the first image displayed does not show up. If you clink on the blank area, ...
0 votes
1 answer
22 views

How to add Support to show Fullwidth Featured Image of Custom Post Types in Wordpress.?

I had created custom post type called "Case Studies" for my Website. Now whenever I am trying share any Post from Case Studies in LinkedIn it showing me preview as small thumb image along ...
0 votes
1 answer
20 views

add_image_size function not working

In functions.php i have, function university_features() { add_theme_support('title-tag'); add_theme_support('post-thumbnails'); add_image_size('professorLandscape', 400, 260, true); add_image_size('...
0 votes
1 answer
48 views

Bulk-add featured images in posts with no featured image

I have a site with loads of posts (news items). Some posts don't have featured images yet. Adding the images to those posts (few hundreds) is a tedious task. We basically want to add 1 and the same ...
  • 111
0 votes
0 answers
20 views

WordPress stopped generating image thumbnails after changing hosting environment

I moved my WP website from shared hosting, to Digital Ocean LEMP stack droplet. I noticed that thumbnails aren't generated any more for new post featured images, I also tried manually regenarating ...
  • 101
0 votes
0 answers
25 views

Need to add a post’s featured image to a section on the frontpage

It looks like I will need to create custom PHP code for this and either add it to my includes directory within a custom PHP file, or to the functions.php file. I need the ability to use a featured ...
0 votes
1 answer
45 views

Automatically add images to a menu

I am calling a menu into a page, but I want to add images next to the title of the menu items. I have this code: <ol> <?php $navMenu = wp_get_nav_menu_items(2096); /*/Pass Nav Menu_id or ...
  • 167
0 votes
0 answers
11 views

Custom image sizes showing in Classic Editor only when upladed directly to post

I can't get custom image sizes to appear in Image details size selector unless the image is uploaded directly in the post. If you choose an image from the Media library only default image sizes are ...
  • 1
0 votes
0 answers
16 views

theme directory fallback image outputs url and not the image

I am adding a custom post thumbnail column to the user admin table in WordPress. I want to retrieve a fallback image from my theme image directory if no post thumbnail has been created. I don't want ...
  • 125
0 votes
1 answer
24 views

Display term picture of each post in a loop

I'm trying to solve a problem I have for many days. I'm posting it here in case some of you would know the answer. I want to display a grid of 9 posts on my homepage. Each of these posts has one ...
0 votes
0 answers
23 views

Thumbnails not being generated for PDF files

I have installed all the required extensions like ImageMagick, Imagick, and Ghostscript. I used a plugin to test the requirements and everything passed. ImageMagick: Installed Imagick: ...
0 votes
0 answers
56 views

Post Thumbnail missing when using webp format while sharing

I have a problem when I upload a featured image for my post in jpg format, I get the featured image's thumbnail while sharing my post through any kind of messenger e.g whatsapp etc. But when I try to ...
0 votes
1 answer
224 views

How to display WooCommerce category image in my category page banner as a background?

I am creating one WordPress website from scratch, where my client needs WooCommerce category image as a background for all respective categories pages, usually I call page banner like this, but this ...
  • 13
0 votes
0 answers
24 views

Thumbnail size problem Desktop vs Mobile site

I have a problem with the thumbnail I setup Customizing ▸ WooCommerce ▸ Product Images The desktop page version shows a smaller thumbnail and the mobile site show the biggest version, Google page ...
  • 1
0 votes
2 answers
95 views

How to hide featured images of all posts falling under the same category in wordpress?

Is there any plugin or alternative method to hide featured images of all the posts falling under the same category? Please guide. For example: There's a website category: abc.net/category/fruits Under ...
  • 1
0 votes
0 answers
21 views

Possible to show in media library if images are being used as featured images?

Is it possible to make an admin column in the media library that will indicate whether or not an image is used somewhere as a 'featured image'?
0 votes
1 answer
74 views

How do you code a featured image into an XML as a jpg link, instead of using a data-id number?

All I want to do is get Wordpress's featured image XML code to use a jpeg link as the meta_value, instead of the image gallery data-id number. Basically change this code: <wp:postmeta> &...
0 votes
1 answer
70 views

Revision featured image

In WP revision i can not see if i upload featured image and update post. WP revision save just content, heading and excerpt. I have problem with some employs, they said that uploaded image and we do ...
0 votes
1 answer
22 views

I can't set image ad fatured programatically

I have a problem when I try to set image as featured. I don't know where is the fail, I upload the image from a URL in the same server and then try to set it as featured. The code upload the image but ...
  • 1
0 votes
0 answers
58 views

Allow webp use on website but disallow webp as featured image during post creation

I am currently using webp images with the help of imagify plugin on my website. The problem is when creating a new post and setting a webp as featured image, the og:image wont show the webp image in ...
0 votes
0 answers
19 views

Cropped featured image

I have the code below in functions.php and have already regenerated the thumbnail of the featured image and I can see the custom size is generated as well but still the size of the featured image on ...
  • 1
0 votes
1 answer
206 views

How to apply filter on get_the_post_thumbnail()

my client want me to add a custom fields for thumbail, so the logic will be if custom_thumnail is empty, render the origina. But i don't like idea of writing if statments everywhere + am using SEO ...
0 votes
0 answers
55 views

Upload Image with a file URL and show dynamically on Frontend

Please help! I am a newbie on Wordpress. I am looking for a workaround or plugin which can help me upload an Image on the backend (like thorugh WP Frontend Admin plugin. and on the Frontend, it comes ...
0 votes
1 answer
249 views

How to get a page's featured image from a term slug (same name)

I have this code (that i've inserted into archive.php) that displays a page's content on the corresponding post category archive with the same slug. <?php $term = get_queried_object(); ?> <?...
  • 976
0 votes
1 answer
78 views

my featured image of wordpress are not showing in the front end though image are uploaded in media library

my featured image of wordpress here https://share-ask.com/about-robin-uthapa/ are not showing in the front end though image are uploaded in media library . can any1 help. When i upload new image & ...
0 votes
0 answers
21 views

My theme header is stuck on a low resolution image?

My responsive header is stuck on the medium-large srcset regardless of width UNLESS I'm in DevTools. I have disabled all CDN's and image resizing, but now this seems to be browser behavior i cannot ...
0 votes
0 answers
8 views

i need to have a tab with gategory post

i have a custom type named gallerie i need to create a tab with category in each category show ther post . i have this code but didn't work for me ''' <section> <div class="container&...
0 votes
1 answer
58 views

Put featured image under post title in admin area

Instead of inserting a new column with a featured image on it, I would like to put the featured image under the post's already existing title. I can't seem to figure out how you insert things on the ...
  • 130
0 votes
0 answers
28 views

How to only show div of caption if caption exists on featured image

I am trying to only show image captions on featured images. However, if the image does not have a caption, I do not want it to show the <figcaption> tag. I have added the following code to my ...
0 votes
0 answers
21 views

Delete media from the post but keep my featured image and post

I have a lot of posts on my news site, I have a problem with space, I would like for posts older than three months, to delete the images that are in the post, but to keep the featured images and the ...
  • 1
1 vote
1 answer
248 views

wp_get_attachment_image function size argument not working if I also add a custom class

I'm trying to output some images the right way, using the wp_get_attachment_image function. Here's how I do it: echo wp_get_attachment_image( $image_id, 'image-size', '', [ 'class' => 'some-class' )...
  • 13
1 vote
1 answer
616 views

How to use SRCSET with get_the_post_thumbnail()?

My wordpress theme uses get_the_post_thumbnail() to display Thumbnails on Posts. I have set custom image sizes but running it through Lighthouse gives following error. Serves images with low ...
1 vote
0 answers
39 views

Wordpress auto generates small medium and large of an image on upload, how can we guess their links?

WordPress out of the box has an integrated image sizes system, which creates files ( thumbnail, S, M, L) but in the media library, it only shows one original file size link. Let's say, I upload a file ...
0 votes
0 answers
211 views

Add Featured Image to Existing Post

I have already created thousands of product as posts (CSV Import). They have a custom post type. Now, I would like to assign featured image to each existing post programmatically (without manually ...
  • 15
2 votes
0 answers
102 views

Regenerate thumbnails unexpected resolution (96 x 96)

I'm using WP CLI wp media regenerate to resize my thumbnails. I've noticed something a bit weird. The original image I upload is a JPEG with a resolution (DPI) of 72. The images that are generated ...
  • 1,953

1
2 3 4 5
32