Skip to main content

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
35 views

add_image_size() parameter four ($crop = true) is ignored: the_post_thumbnail() returns scaled image(s) instead of hard cropped

Good Day! I am trying to achieve hard cropping of thumbnails in a custom WordPress theme. In functions.php I have added add_image_size('blog-large', 860, 484, true);. Thus, the fourth parameter ($crop=...
dfr's user avatar
  • 11
0 votes
0 answers
14 views

Set Featured Image Grab Image ID or Image File Name

Is there way of to grabbing "Image ID" or "Image File Name" after attaching a featured image (post-thumbnail) to page? I am looking to capture that ID so that I can validate the ...
Fred Mozer's user avatar
0 votes
1 answer
30 views

get_the_post_thumbnail() alt and title attributes missing

Isn't get_the_post_thumbnail() supposed to output the alt and title attributes according to what is set for the image in the Media Library? When using get_the_post_thumbnail() in Wordpress 6.6, no alt ...
arrr_matey's user avatar
0 votes
1 answer
56 views

Media Library it doesn't show any of the uploaded images after updating wordpress 6.6.2

I have this problem since wordpress was automatically updated by whm/wp-toolkit. I continued to use the "Media Sync" plugin to return the images to the "Media Library" and it works....
Ora's user avatar
  • 1
0 votes
0 answers
16 views

If YouTube Link in Excerpt use Featured Image as Video using Excerpt Link in Text Else Get Featured Image

I Currently Using Custom Excerpts Where I Allow Tags for YouTube Videos as Feature Videos, Whereas when I Insert a Featured Image the video is also displayed. I require one featured Image or Video ...
Islamic Quran Center's user avatar
0 votes
1 answer
24 views

Featured Image add tab

I was wondering if there's a hook/function to add a new tab to the Featured image modal window as shows in the picture below: I've found this thread How to add new tab to media upload manager with ...
mikebrsv's user avatar
  • 101
0 votes
2 answers
42 views

How to get Custom Post Type (CPT) Archive Page's Posts Featured Images Preload in header.php

I am trying to Preload all Images of the Custom Post Type Archive Page's Posts Featured Images Only. Mean in header.php I want to set code in and implementation should only be on the Custom Archive ...
Islamic Quran Center's user avatar
1 vote
1 answer
198 views

Can I use Post Thumbnail with Block Bindings API

I have a pattern template for a custom post type which uses the Post Thumbnail Block as a placeholder for the thumbnail when/if it is set. However the Post Thumbnail Block does not support opening the ...
lepardman's user avatar
  • 334
1 vote
1 answer
58 views

Button over featured image on hover

I'm working on this page - https://careers.clydemunrodental.com/our-clinical-team/ and I'm using the divi blog pro plugin with the module DP Post Masonry Grid. I want a button to appear when I hover ...
poppythewitch's user avatar
0 votes
0 answers
28 views

How to get rid of a blank space where the featured image used to be?

I want my featured image, or post thumbnail, for the post to be displayed on the "posts" or "home" page (they are the same on my site), but not on the actual post. This is easy ...
Car's user avatar
  • 1
0 votes
1 answer
44 views

Getting the wrong featured image on archive page

I assigned my posts archive to a site on settings -> reading. I added a post thumbnail to this site, and i want to show the image with a shortcode i have written in my plugin. The problem is, that ...
LovinQuaQua's user avatar
1 vote
1 answer
283 views

How to get a page's featured image through REST API?

The featured image of a post/page is not included when using REST API. Not only that, getting it is not particularly simple. This seemingly irrational fact apart, I tried to implement this answer but ...
drake035's user avatar
  • 1,197
0 votes
1 answer
42 views

Changable favicon based on post-featured image

its possible use to change the favicon on based the post-featured image icon? I use 100x100 size or 64x64 icon images on my posts. I want these icons to show as a favicon also. if some posts not have ...
SS Apps's user avatar
1 vote
1 answer
35 views

WP "optimizing" PNGs into thumbnails 5X larger than originals - FIX

As I am about to add over 50,000 product photos to a site in development, I am more than concerned about the thumbnails being generated and “optimized” by WordPress. Between WordPress, Woocommerce, ...
Swapot's user avatar
  • 11
1 vote
1 answer
178 views

How do I add text or message above the featured image area in gutenberg for a CPT

I'm hoping to add text above the featured image box in the gutenberg editor to let people know what size of image to upload. I've pieced together how to do this for all posts, but I don't know enough ...
rudtek's user avatar
  • 6,333
0 votes
1 answer
37 views

Second featured image only shows in metabox preview after saving a post in the wordpress editor

I am trying to add a second featured image to the Wordpress post editor, and it seems all be working. When I select and image from the mediauploader the first time the image shows in the preview of ...
Brango's user avatar
  • 1
1 vote
1 answer
192 views

Get featured image thumbnail and inserting into custom field on wordpress posts

I'm not a developer so trying to put this together has not been successful. Hope someone can assist! My goal - create a custom field on a wordpress post when a post is published or updated which ...
StevieK's user avatar
  • 11
3 votes
1 answer
810 views

How do I display a PDF thumbnail as a link to the PDF without uploading the image

When I found a couple of years ago that WordPress will create thumbnails of uploaded PDFs, I was so happy, thinking I wouldn't have to make and upload separate PDF cover images to have a thumbnail ...
bkepl's user avatar
  • 131
0 votes
1 answer
39 views

Featured image on page is not displayed with certain theme: how to debug this?

If using certain theme, featured images on the content type "page" aren't displayed. Content type "posts" displays featured images with this theme. And other themes display ...
Evgeniy's user avatar
  • 105
0 votes
0 answers
47 views

Unable to get the correct URL using get_the_post_thumbnail_url() in wp-admin

I've added some custom fields to a rest route. I want to retrive the post thumbnail for my CPT and I'm using this code: This is the code I'm using to add the post meta to the CPT after an image is ...
OHICT's user avatar
  • 133
1 vote
1 answer
243 views

Featured Video replacing Featured Image

I am trying to create a list of an "animation" post category, where each of these posts has a video associated with it. I want the video to be accessible inside the post itself, of course, ...
The Feadow's user avatar
0 votes
0 answers
584 views

Site Logo is overriding my post featured image on Social Media

Using my site logo is necessary for my website header/header image to propagate properly on all formats. Unfortunately, when active, it overrides any featured image for a new post whenever the post is ...
1st  Goal Web Solutions's user avatar
0 votes
1 answer
168 views

Restricting Image Upload Sizes using 'wp_handle_upload_prefilter' - Stuck media progress bar when Featured Image?

I have grabbed this function and adjusted it to my needs. add_filter( 'wp_handle_upload_prefilter', 'check_image_dimensions_during_upload' ); function check_image_dimensions_during_upload( $file ){ ...
dekkyd's user avatar
  • 7
0 votes
0 answers
15 views

What to input into table header to import featured images with CSV or XML file?

I'm using the Really Simple CSV Importer plugin and what to import featured images in bulk for my content items. I've tried multiple combinations like: post_image post-thumnail What could I put into ...
Bruno  Vincent's user avatar
0 votes
1 answer
697 views

Get the featured image of an ACF relationship field

I have an Advanced Custom Fields field group with ID group_61318c077c7d6. I've made this field group visible for Block = 'slider'. In that field group is a field with ID field_61318c078a746, a ...
Steve's user avatar
  • 1,747
1 vote
0 answers
42 views

Extend file format support for post thumbnails

I am trying to enable video thumbnails for posts in my theme. I created a custom post thumbnail media uploader in an editor plugin as follows (This is necessary, because the default uploader can't ...
TimMKuehle's user avatar
0 votes
1 answer
31 views

Hot to change resized image link on posts

I have 5000+ posts therefore could you help me to change url link addresses of images on posts as below? I want to change the urls of resized images to their original url. Before: asd.net/wp-content/...
Korhan's user avatar
  • 1
0 votes
0 answers
59 views

Display only posts with thumbnails

I'm trying to have a WP theme display only posts that have a thumbnail. Below is the code of the file that shows some posts on the frontpage. I've already tried to change the code (please see the //...
Johnny Bravo's user avatar
1 vote
1 answer
218 views

wp media regenerate says "no regeneration needed" whe that's no the case

I'm trying to generate thumbnails for a PDF attachment. Right now in the uploads/ folder there is only the PDF file, no image thumbnails related to it. But when I run the regeneration with : wp media ...
mike23's user avatar
  • 6,029
0 votes
1 answer
120 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 ...
Mari's user avatar
  • 11
0 votes
2 answers
564 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 ...
GULSHAN's user avatar
1 vote
0 answers
50 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....
Mi2's user avatar
  • 11
1 vote
1 answer
472 views

medium_large image size not displaying properly on the frontend?

I have added a code snippet to utilize the "medium_large" thumbnail size. This works fine on the back end and I can select this image size in all image blocks. It also seems to output the ...
GregF's user avatar
  • 11
0 votes
1 answer
339 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 = "...
Johan's user avatar
  • 309
0 votes
1 answer
325 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 ...
jligda's user avatar
  • 3
2 votes
1 answer
4k 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() ?>...
Hubro's user avatar
  • 151
0 votes
0 answers
51 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, ...
Josip Bogdan's user avatar
0 votes
2 answers
183 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 ...
NBgr's user avatar
  • 11
0 votes
1 answer
8 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, ...
Luca Reghellin's user avatar
0 votes
2 answers
38 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 ...
PhpDoe's user avatar
  • 299
0 votes
1 answer
72 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() ...
Steve's user avatar
  • 1,747
0 votes
1 answer
825 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 ...
Md. Sabbir Al Mamon's user avatar
0 votes
1 answer
196 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 ...
Fluxian's user avatar
  • 180
1 vote
1 answer
2k 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] => ...
Fluxian's user avatar
  • 180
0 votes
0 answers
37 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 ...
Jason O's user avatar
0 votes
0 answers
17 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 ...
fjimenez's user avatar
0 votes
1 answer
296 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 ...
Rakshith's user avatar
0 votes
1 answer
30 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 ...
vyperlook's user avatar
  • 177
0 votes
1 answer
422 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', '...
Suffii's user avatar
  • 201
0 votes
0 answers
53 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 = ...
Aprilia Parrino's user avatar

1
2 3 4 5
33