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
0 answers
9 views

Close featured image modal windows with JS

I'm developing a plugin which let you select a fectured image for a post from an external resource e.g. an API When I select an image, I want the image select window to close. I have tried with: wp....
0 votes
0 answers
10 views

Crop custom image size vs actual size

I need to use specific image size with add_image_size to true using ACF image field and wp_get_attachment_image From this side, my image is displayed well and resizes well in 175*200. I would like to ...
  • 13
0 votes
1 answer
33 views

Images thumbnail not cropping square

I'm trying to create a related post file with squares images. In the functions.php I've added the following code: function my_theme_setup() { add_theme_support('post-thumbnails'); // Add ...
  • 11
0 votes
0 answers
16 views

Place the Featured image on a post, before the first <h2> via code

I'm making a custom theme andar I need to place the featured image, right before the first of a post, via code. I don't know if it's even possible. The idea is, somehow, in the loop, get the first ...
  • 11
0 votes
0 answers
6 views

Edit multiple posts featured image

Actually I imported posts from my another website, but I have only posts & their authors & their category & featured image is showing blank means not present. Now at every time I have to ...
0 votes
0 answers
15 views

Is there a way to upscale a media library original image to the nearest whole pixel in Wordpress?

I noticed today while manually regenerating thumbnails for images in the media library that at least one would not generate thumbnails for those sizes that had the same width as the image. In fact, ...
0 votes
2 answers
18 views

website images getting corrupt automatically

I have just migrated my website from hostinger to hostinger manually. And now when I upload any picture on my website the photos getting corrupted automatically. Although the picture was shown on my ...
1 vote
0 answers
18 views

Why not attaching images after impoting using wp cli

I want to move posts from one site to another, because of the big amount of posts I am trying with wp-cli import. The destination site also has huge amounts of posts, now when I am importing XML files....
  • 11
0 votes
0 answers
7 views

Wordpress pointing animated GIF images with wrong file name upon upload (GIFs animation not working)

y’all! How are you doing?! I’ve been struggling with animated GIF images on my website for a while now, and I discovered the problem, but not the solution, still. When I upload an animated GIF as a ...
0 votes
1 answer
53 views

set_post_thumbnail or media_sideload_image adds image multiple times in media library

I am trying to add the featured image to posts and that works, however, the featured image is apparently set everytime I check my post. <?php $post_id = get_queried_object_id(); $bla = "...
  • 299
0 votes
1 answer
46 views

How to I remove Featured Image from the Posts/Category Lists?

It seems like this should be easy, but I do not see an option to exclude the featured image from the category index pages, or posts index pages (whatever they are called). Here is an example of the ...
  • 3
1 vote
1 answer
254 views

How do I work with responsive images in Wordpress? (img srcset/sizes)

I'm trying to make a Wordpress theme and I'm very confused about how I should use responsive images. Here's how I'm currently displaying each thumbnail in my post list: <? the_post_thumbnail() ?>...
  • 141
0 votes
0 answers
11 views

Show a featured image with "Link" Post Type?

When I use a Post Format type of "link", no featured image shows up, just the URL on a blue background where I would expect the Featured Image to appear. A Post Format of "Video" ...
0 votes
0 answers
25 views

get_post_thumbnail_id() not getting correct featured image after post edited

Hy, everything works fine until I change featured image by editing post, using wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),"full") I get the url to the original picture, ...
0 votes
0 answers
13 views

Is mytheme_post_thumbnails() still necessary?

What is this code for? I found this code in the functions.php function mytheme_post_thumbnails() { add_theme_support( 'post-thumbnails' ); } add_action( 'after_setup_theme', '...
0 votes
0 answers
10 views

I tried to move the featured image below the paragraphs but now it is displaying twice

I already have a featured image and I moved it to the below paragraphs but now the featured image is displaying twice. I don't know what I'm doing wrong here. add_filter( 'the_content', '...
  • 1
0 votes
2 answers
41 views

Import alt text in set_post_thumbnail

I am using set_post_thumbnail in order to programmatically attach an image to my posts. I was wondering how to set a different alt text for this image, for every post, meaning that the same image ...
  • 11
0 votes
1 answer
7 views

Why some images are not allowed to be edited only for thumbnails?

please see this: As you can see, on the right columns I don't have the classic 'apply to' radios, where you can choose to apply modifications only to thumbnails. It happens only with certain images, ...
0 votes
0 answers
23 views

Delete old thumbnail when updating new

I have a situation when I update a new featured image, I have to delete the previous one. because it's taking up too much space. Is there any custom code or plugin that can help me? Thanks In Advance.
0 votes
0 answers
24 views

How to import external media items into wordpress media library (without using storage)

I want to use image that are hosted somewhere (Blogger), but i didn't want to use my website storage. I recently tried some plugin (FIFU) but it only work with url on post editing window but i want to ...
  • 37
0 votes
2 answers
30 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 ...
  • 105
0 votes
1 answer
39 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,666
0 votes
0 answers
81 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
44 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
192 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
43 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
62 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
13 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
50 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
27 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
16 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
89 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', '...
  • 201
0 votes
0 answers
41 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
40 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,665
0 votes
0 answers
17 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
24 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
55 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
152 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
21 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
26 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
97 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
1 answer
36 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
46 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
116 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
462 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
60 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
248 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
162 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> &...

1
2 3 4 5
32