People who code: we want your input. Take the 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
0answers
5 views

How to use html or content block (a countdown timer) for a featured image for a specific post

I have the timer in a content block. Is there a way to add the content block as the featured image? Or just the html somehow? There is a thread on similiar situation in Aug answered by Nate Allen-...
0
votes
0answers
18 views

I want to Host Wordpress thumbnails as base64

how to base64 encode images in wordpress template I followed the tutorial from this and pasted the code in functions.php file Now i am getting problem in temtplate level I want to imageEncode() the ...
0
votes
1answer
94 views

How to use <picture></picture> tag in featured image

In my WordPress site 5.5.1 version so, we uploading jpeg images so we want to page speed for upload webp images. Webp images are not supported by a few browsers. so how to switch images format like ...
0
votes
0answers
12 views

Control image size of get_post_thumbnail_id()

I am working with WooCommerce product image. My code is like below if ( ! function_exists( 'woocommerce_template_loop_product_thumbnail' ) ): function woocommerce_template_loop_product_thumbnail() ...
0
votes
0answers
9 views

WooCommerce replace product edit screen thumbnail

I am currently using external image sources for my products on WooCommerce. So i would like to replace the default thumbnail / image across the site. I have managed to do this everywhere with the ...
0
votes
0answers
24 views

Blank featured image in media library only with variable url, but work nicely with static image url

I create plugin who create my posts from content files. My featured images are a list of urls. In CASE n ° 1, I test with a static url, the image is well imported and present in the media library (as ...
0
votes
0answers
169 views

Custom image size not displaying with wp_get_attachment_image()

I created a custom image size for my portfolio thumbnails add_image_size( 'gallery-thumb', 240, 180, true ); I created a shortcode to display all images using a lightbox with lazy loading to ...
0
votes
0answers
149 views

Automatically adding pdf thumbnail as featured image

I have managed to get new posts created using a public gravity form that uploads a pdf and a jpg. I have PDF thumbnails generated when uploaded to the media library and I have code that will select ...
0
votes
1answer
61 views

Can set_post_thumbnail be used to remove a thumbnail?

I have a way to set a thumbnail for a post if a checkbox is selected or not. The problem I'm having is if the checkbox is selected and then unselected, how do you delete the featured image that was ...
0
votes
0answers
11 views

Display Multiple Photos as Featured Image when mouse moves on to it post

I need to add some photos (3 or 4 photos) to the post thumbnail (featured image) and should be displayed image 1, 2, 3 & 4 when mouse moves on to the post thumbnail...How can I do that. Please ...
0
votes
0answers
58 views

Can I use 'Featured Image' as a hero image and a thumbnail?

I am finding a lot of great information for using the_post_thumbnail() to use this feature as a post hero OR a thumbnail, but I'm struggling to figure out how to use the 'Featured image' as both in my ...
1
vote
1answer
195 views

How to display a default image for post thumbnail using functions.php?

I want to display a default featured image if there hasn't been one set. I googled for a solution and all I could find was this piece of code (below). My question is, is there a way of displaying a ...
0
votes
0answers
9 views

Thumbnails not displaying on web page

I have been struggling with correcting this error for a while now, I have no idea as to what is causing it. The posts thumbnails are not displaying on the page, however the pictures in the posts are ...
0
votes
0answers
13 views

How to make Feature Image required for a Particular Template

For a particular post, I use a specific template (Story template) to display it. And any post with this particular template should have Featured Image. I am using this snippet code to check if the ...
0
votes
1answer
211 views

Featured image error after importing blog posts

I exported blog posts to an xml file from a WordPress website and then imported them to another. I moved over all the images in their correct folders via FTP and then used a plugin to register them in ...
0
votes
1answer
42 views

How to deal with wordpress images?

I have blog post featured image that has specific size. then I want to display it with its excerpt in different page called front-page.php, but I want to display it with larger size. It already appear ...
0
votes
1answer
15 views

Search results thumbnails different size

Seems that according to the nature of my theme, whenever I do a search query and a result from my Projects section appears, the pictures appear huge and even break the footer! Whereas if I do a search ...
0
votes
0answers
14 views

Resizing images only for WooCommerce categories

I'm trying to resize images just for category pages for a WooCommerce site I'm building. Essentially, I want image square throughout the site, but 3:4 for WooCommerce categories. I thought this code ...
0
votes
1answer
47 views

How to use default image as featured image by implement some code in function.php

I want to use a default image as a featured image for all those Posts and Pages, where is not any selected featured image from media. I have tried this code in function.php but not working, function ...
0
votes
1answer
308 views

Is it possible to set Featured Image using HTML?

The Amazon affiliate program does not let you download images from their site and upload it via their server. One authorized way of using images from Amazon is to use their API or Sitestripe. For new ...
0
votes
1answer
38 views

Category images are not displaying in WordPress

I have categories list with there respective images. I am able to get the category name and description but I am not getting the category image. I tried the below code. <ul> <?php ...
0
votes
0answers
30 views

Have get_the_post_thumbnail output different image if custom meta exists

I have a meta box on each post where a user is able to select another image from the media library. I want this image to override the output whenever get_the_post_thumbnail is used across the whole ...
0
votes
1answer
450 views

How to force Wordpress to upscale images?

I have a bit of a problem with my Wordpress images. I want to force Wordpress to upscale images, so that the preferred add_image_size is always available. I'm adding the sizes as follows: //Theme ...
0
votes
1answer
33 views

Can't locate custom image sizes defined by child theme

I'm developing a child theme (mms-child) based on a simple parent (mms – also my dev). I am quite used to the usual way of defining custom image sizes within functions.php as follows: ...
0
votes
1answer
25 views

Why doesn't WordPress use the smaller sized image?

I've been trying to understand how WordPress picks images to use depending on the size of the user screen, but I've been unable to figure it out. Is it just by checking if the request is coming from a ...
0
votes
1answer
25 views

show thumbnail for subcategory wordpress

$args = array('parent' => 17); $categories = get_categories( $args ); foreach($categories as $category) { echo '<p>Category: <a href="' . get_category_link( $category->term_id ...
0
votes
0answers
26 views

the_post_thumbnail doesn't resize properly

I am using the_post_thumbnail and when I do the image will not resize properly. It retains the height so it just squeezes down until the media query kicks in. When I just load the image via my cdn ...
0
votes
1answer
35 views

Is it possible to get_the_post_thumbnail (Featured Image) inside a sprintf function?

I am trying to add the featured image of posts to my mega menu. I want to display the featured image inside a div tag. How would i add the featured image inside of a sprintf function? $thumbnail = ''; ...
1
vote
1answer
502 views

How to change post featured image using a custom field of category?

I have added an image custom field for categories, in which I assign an image for every category. Something like this: I have a custom post type, and for each post I publish in this post type, I ...
0
votes
1answer
25 views

Show a default image

Hello how can I do with this function if there is no post thumbnail loaded, show a default image echo get_the_post_thumbnail( $page->ID, 'image' );
0
votes
1answer
30 views

How to change the format of thumbnails into wordpress theme?

dear community. I have question about changing the format of thumbnail into WordPress theme. I want to change all generated images format into a theme to *.webp. I already have generated *.webp images....
0
votes
1answer
21 views

What sense makes medium_large_size_h => 0?

WP Version 5.4.2 There is an image size definition of medium_large with size_w = 768 and size_h = 0 - You can find it near line 530 of wp-admin/includes/schema.php: // 4.4.0 'medium_large_size_w' ...
0
votes
0answers
35 views

Wordpress Multisite: Images moved to /sites/1?

I noticed that my older images are no longer getting resolved by Wordpress 5.3.4. - the file doesn't exist on that path and 404 gets returned. For images that were originally uploaded to https://www....
1
vote
1answer
113 views

Add instructions to featured image

How do you add instructions to the featured image field (see attached screenshot) - something like: "recommended dimensions - H980px by W450px"..?
0
votes
1answer
31 views

Need clear explanation about medias/files/attchments

During an import, I need to add images and linked to a custom post using WPML like : post 1 in french 1.1 picture foo.jpg (visible in library and attached to this post and add as featured image ) 1.2 ...
0
votes
0answers
6 views

How to automatically resize featured image?

I'd like to automatically resize the feature image so that large ones will be displayed fitted in the screen? I really have no idea how to begin.
0
votes
1answer
20 views

How to calculate the sum of all featured thumbnail height on Wordpress?

In an archive page, I need to calculate the total height of a which is the container of many featured thumbnails, knowing that all the featured thumbnails have different heights (but the same width) ...
0
votes
2answers
35 views

How to echo images Urls from a wordpress post, that are relally in the post

I have a question. I use the following code to output the image URLs of a wordpress post. The image URLs are related to the "attached images" of a wordpress post and not the ones that are ...
0
votes
0answers
16 views

Images not displaying on an e-commerce website

what can be done when a wordpress website does not display images except when clicked on? The image placeholders display grey and not the images. Thanks.
0
votes
1answer
143 views

Child Theme not overwriting Parent theme php file

I'm new to Wordpress and how Child themes work. My child theme I am trying to overwrite two files in sub-directories. I've copied the parent files and edited them in child theme but changes are not ...
1
vote
3answers
43 views

WP Post-Thumbnail

I've already saw the question some times here, but sadly nothing helped me out yet. Right now I've got following code: <h2 class="title_bar">Videos</h2> <ul class="vlist&...
0
votes
0answers
8 views

Post Thumbnail Uploaded pragmatically and attached with post but not showing on Front-end or Post Edit Page

I am trying to do something like this. For multiple file upload, I want to create a post for each image and attach that image with the post. Everything is working. As you can see in the picture image ...
0
votes
0answers
11 views

how to modify the subtitles in the WordPress gallery (h4)

When I create an image gallery in a wordpress entry and put their titles on them, they appear in H3 Any way to change them to be on h4? example of a gallery image created in WordPress : <figure ...
0
votes
1answer
41 views

Conditional post thumbnail based on logged status and post tag

I'd like to show different post thumbnails in archive.php and category.php like this: user logged out & post has tag "private" -> shows a "default-private" image user logged in & post has tag ...
1
vote
2answers
385 views

Force documents to appear in Featured Image dialogue

Having a perplexing issue... ...for a custom post-type called 'Resources' I used the 'Featured Image' or 'thumbnail' function within WordPress to allow users to attach documents to 'Resources'. The ...
0
votes
0answers
390 views

Wordpress Responsive Image ( srcset ) not work properly

I have a very strange problem There are images with the correct size on the host and image sizes are properly recorded in WordPress But I get the following html code output <img width="300" ...
0
votes
0answers
103 views

Is there any way to set the Featured image in wordpress post editor, using a Getty images embed code

I want to be able to use a Getty images embed code to set the featured image (Post thumbnail) in my wordpress post editor. Is there any way of doing this? I understand that Wordpress doesn't allow ...
0
votes
0answers
24 views

Image size doesnt change via wp_get_attachment_image_src

Edit: I want to show thumbnail with custom size.So, I mean scale the thumbnails to avoid load heavy size to browser.I couldnt do it. Here is my code in my plugin: <img class="img-responsive img-...
0
votes
2answers
203 views

Adding guiding text to the 'Featured Image'-box in the backend

How do I add some guiding text under the 'Featured Image'. Right here: I have experienced several times now that people don't get where and what this is. So it could be nice to be able to add a ...
1
vote
0answers
36 views

Set Featured Image by URL Form Post

How do I append a form URL to set as my featured image? I am working on a user frontend submission site that is pretty basic and using WP User Frontend Plugin. I finally figured out the GIF URL ...

1
2
3 4 5
32