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
8 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
28 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
26 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
33 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
18 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
16 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
10 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
21 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
17 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
66 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
22 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
16 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
12 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
16 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
34 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
26 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
15 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
22 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
9 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
51 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
25 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
7 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
9 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
0answers
10 views

Creating a “completed” or “inprogress” banner across projects featured image

I am trying to create a custom banner that appears on the featured image of the of a project based on a status they input. Does anyone have any good tutorials or easy plugins that this can be done> ...
0
votes
1answer
18 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
112 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
35 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
6 views

ACF Gallery field - Auto load all posts featured images

Is there a way to load all featured images from one post type from one post category into an ACF Gallery field which updates the load query for example on each field request or other auto triggers? ...
0
votes
0answers
7 views

How to add one image as featured image on all posts in WP?

I am looking for a way to add one image from the media gallery as a featured image on all posts that will be published on my Wordpress. Is there any plugin that does this job? Or any other way?
0
votes
0answers
13 views

How do you change the thumbnail size on WP link embed in the Block Editor?

When I use the WordPress Embed block in the Block Editor, the preview image pulls the thumbnail (150px) and stretches it, rather than grabbing the featured image and sizing it down. How can I change ...
0
votes
0answers
29 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
10 views

What is the difference between Homepage thumbnails image and Featured Image

My site theme, Schema has a different homepage thumbnails image and featured images but which one the google will be crawling, because google recognize the image size of at least 1200 wide. my site ...
0
votes
0answers
17 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
14 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
29 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 ...
0
votes
0answers
13 views

Extract width and height values from add_image_size in Timber

I have set the following custom image size in my functions.php file: add_image_size( 'search-image', 320, 250, true );. In my search.twig file, I am using <img src="{{ story.thumbnail.src('search-...
0
votes
0answers
33 views

Generate and upload screenshot as featured image for user-submitted post

I have a website where users can submit posts (the posts must have a URL of a website). I would like to use a screenshot of that URL to be the featured image. I have used this code to generate the ...
-1
votes
1answer
93 views

Change image on post title hover (more than one instance) - Jquery

I created a loop of posts from terms having a block for each term like the following: - Term title Featured image of one post from that term List of all posts for that term - Right now I'm using ...
1
vote
0answers
12 views

Set size for attachments

I am working on a custom theme and have generated content with FakerPress to include some uploaded post images. I want to ensure any image uploaded as an attachment in a post displays in one of the ...
1
vote
0answers
20 views

Use AJAX to fetch Current Post Thumbnail for Wordpress when Uploaded throughMedia Uploader Frontend

i Use WordPress Media Uploader on Frontend to allow users to upload Thumbnail for there UGC site. I also show a Preview of the Image on Frontend. When a user clicks the button the Media Uploader opens ...
0
votes
1answer
37 views

How to Display Image Caption but Not Alt Text

I'm trying to display images with their caption, but when I do it displays both the caption and that alt text. I've tried to use unset( $fields['image_alt'] ); to hide the alt text, but it does ...
0
votes
1answer
5 views

Mysql update menu_order problem

I trying to update menu_order if post_type product not have _thumbnail... Tried: UPDATE phiz_posts SET menu_order = 1 WHERE ID IN (SELECT ID FROM phiz_posts LEFT JOIN phiz_postmeta ON phiz_posts.ID =...
0
votes
1answer
16 views

How to put 2 php codes in functions.php without site crashing

I can use either the php script for a menu <!-- menu --> <?php function wpb_custom_new_menu() { register_nav_menu('my-custom-menu',__( 'My Custom Menu' )); } add_action( 'init', '...
0
votes
0answers
33 views

remove_filter function to unhook twentysixteen parent theme function

I've used the following code in my child theme function.php to remove custom image and thumbnail size attributes function remove_parent_function_img_size_attr() { remove_filter( '...
0
votes
0answers
16 views

display div tag only if post has thumbnail

I would like to display post thumbnail and excerpt side by side but even if post hasn't got a thumbnail its div still there to be seen. How could I disappear thumbnail's parent div? So far I've tried ...
0
votes
1answer
30 views

Is there a best practice remediation for PhpStorm's warning that void function the_post_thumbnail is used?

In a plugin I'm working on there is a line: echo the_post_thumbnail(array(155,55)); It throws a inspection warning: 'void' function 'the_post_thumbnail' result used Is there a best practice ...
0
votes
0answers
19 views

How To Disable Crop Featured Image or Make it like a Movie Poster ( height - 1200, width 750)

I use a theme, where my featured images getting cropped - for a movie review site, it should have featured image much height than weight. Example URL - https://bhtrend.com/entertainment/keerthi-suresh-...
0
votes
0answers
12 views

Show image in wordpress media and assign it to post from bbdd

I have tried to do this in many ways but i just cant figure it out... The process i am hoping for is: Upload image to ftp wordpress upload folder (with year and month, as wordpress usually does). ...
0
votes
0answers
10 views

Image resize using WP_Image_Editor class V.S. using AWS Lambda

I'm using EC2 + S3 + ELB + CF. I would like to resize thumbnails before uploading to S3. In this case, 1) Resize image before uploading to S3(It uses EC2's memory using Wordpress native image ...

1
2 3 4 5
31