Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
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 ...
user avatar
  • 101
0 votes
0 answers
23 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 ...
user avatar
0 votes
1 answer
24 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 ...
user avatar
  • 165
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 ...
user avatar
  • 1
0 votes
0 answers
8 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 ...
user avatar
  • 125
0 votes
1 answer
20 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 ...
user avatar
0 votes
0 answers
14 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: ...
user avatar
0 votes
0 answers
27 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 ...
user avatar
0 votes
1 answer
49 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 ...
user avatar
  • 13
0 votes
0 answers
21 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 ...
user avatar
  • 1
0 votes
2 answers
24 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 ...
user avatar
0 votes
0 answers
20 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'?
user avatar
0 votes
1 answer
44 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> &...
user avatar
0 votes
1 answer
46 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 ...
user avatar
0 votes
1 answer
21 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 ...
user avatar
  • 1
0 votes
0 answers
40 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 ...
user avatar
0 votes
0 answers
14 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 ...
user avatar
  • 1
0 votes
1 answer
55 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 ...
user avatar
0 votes
0 answers
38 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 ...
user avatar
0 votes
1 answer
139 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(); ?> <?...
user avatar
  • 976
0 votes
1 answer
45 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 & ...
user avatar
0 votes
0 answers
17 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 ...
user avatar
0 votes
0 answers
7 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&...
user avatar
0 votes
1 answer
39 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 ...
user avatar
  • 21
0 votes
0 answers
25 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 ...
user avatar
0 votes
0 answers
20 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 ...
user avatar
  • 1
1 vote
1 answer
123 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' )...
user avatar
  • 13
0 votes
1 answer
154 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 ...
user avatar
1 vote
0 answers
38 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 ...
user avatar
0 votes
0 answers
17 views

Add a Call to Action Button to Wordpress Post Thumbnail

I would like to add a call to action button directly beneath the Post Thumbnail on the single post, using Advanced Custom Fields data, using either an action or a filter (not sure which would be most ...
user avatar
0 votes
0 answers
26 views

images destroyed after using wp_get_image_editor

this is a really weird problem. i use wp_get_image_editor to resize my original featured images and save it and display on my website. after uploading and using it as featured image, most of time the ...
user avatar
0 votes
0 answers
29 views

Look for image by class and set as featured image bulk

I'm new here and I have zero knowledge of coding so I hope you can help me. I migrated an old website to new wordpress one and used a plugins to set first image of posts as featured image. but ...
user avatar
0 votes
0 answers
177 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 ...
user avatar
  • 15
2 votes
0 answers
92 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 ...
user avatar
  • 1,913
2 votes
1 answer
63 views

Does thumbnail regeneration edit the database?

I'm using the WP CLI command wp media regenerate to resize all of the images via the /wp-content/uploads directory. Are the new image dimensions registered in the database in any way or does the ...
user avatar
  • 1,913
0 votes
1 answer
35 views

Add class to custom thumbnail

To generate a thumbnail for certain part of my theme i'm using the following code : if(has_post_thumbnail() && !post_password_required() && !is_attachment() && ...
user avatar
0 votes
0 answers
100 views

How to change Gallery image url in product page ? In function.php?

My code is like add_filter('wp_get_attachment_url', function($url){ if(strstr($_SERVER['HTTP_ACCEPT'], 'image/webp')!=false){ return $url.".webp"; }else{ return $url; ...
user avatar
0 votes
0 answers
10 views

Featured images have disappeared in the Trending section only of my website

I just now noticed this appears above the Featured and Trending options at the bottom of the Edit Post page. I really don't think it was there all along. Could it be the problem? Can you suggest what ...
user avatar
0 votes
0 answers
35 views

how to use featured image as full width post banner in single post template

how to use post featured image as full width post banner in single post template. Also i want to hide default post banner in wordpress . I am using generatepress theme , Title , meta Over Full Width ...
user avatar
1 vote
1 answer
72 views

How do I set "Upload Image" as detault "Set Featured Image" window?

We have few WordPress sites with custom themes where new posts are added very frequently (more than 200 posts a day) so we are trying to be as efficient as possible. I tried to google for a solution ...
user avatar
0 votes
1 answer
57 views

wp_query - Exclude the first thumbnail from lazy loading on archives

I have a function that change loading="lazy" to loading="eager" from the first thumbnail in categories and tags. The problem is that this function removes the post thumbnails from ...
user avatar
0 votes
0 answers
26 views

Random featured image in folder with twenty twenty tempalte cover

For one of my wordpress site on a child theme of twenty twenty, I would like to randomly display a featured image (pre-selected in a folder) which changes with each load eg of the page. I succeeded in ...
user avatar
0 votes
0 answers
64 views

Using the admin Featured Image's modal in the front end

I am trying to get the new upload frame of the featured image used in the admin side, but the one used in the front is different. I will show you some screenshots: In the admin section when I click ...
user avatar
0 votes
1 answer
61 views

Which filter fires upon setting a featured image

When I am creating/editing a post and set the featured image, I’d like to display a message to the screen if the file dimensions or size are below a certain threshold. But I want the featured image ...
user avatar
  • 11
1 vote
1 answer
113 views

Setting fallback (default) image to featured image block

I was trying to make a block based theme and encountered a problem trying to set a default featured image in case some posts do not have them. Basically, we used to do this in php <?php if ( ...
user avatar
  • 13
0 votes
0 answers
47 views

insert og image link in wordpress post

I am trying to extraxct the og:image url is there a wordpress plugin that extract og:image url from an external webpage url i need a shortcode to insert that image in my post
user avatar
0 votes
2 answers
41 views

Thumbnail is showing outside its div instead of inside it

I'm echoing the post thumbnail here: echo '<div class="post-image right">' . the_post_thumbnail('featured-portrait-large') . '</div>'; And it works, but it's outputting the ...
user avatar
-1 votes
2 answers
936 views

WP is showing wrong image dimensions

Several times over time I changed sizes of thumbnails WP generate when images are uploaded, always setting bigger size. Recently I set Thumbnail Width 600px width and Medium size Max Width 1800px. ...
user avatar
0 votes
1 answer
45 views

Recent posts on homepage: different thumbnail based on logged in status and post category

This works well on archive.php, but not working on the homepage. For some reason, the first statement doesn't get applied: if a post is in Members category and user is not logged in, it's supposed to ...
user avatar
1 vote
1 answer
24 views

Featured Images Not Loading In Blog Archives

A client running a custom theme recently updated their WordPress version from 5.2.7 to 5.7.1. After this update, featured images in blog archives are no longer loading. The theme has been updated to ...
user avatar

1
2 3 4 5
32