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.

0
votes
1answer
12 views

why get_the_post_thumbnail( the_ID()) echos extra post id

I have the following snippet which adds post thumbnails to products on archive page if matches a given product category, which will output the image but echos the the post id as well. How do I ...
0
votes
0answers
15 views

Set featured image using javascript in post editor

I have built a plugin that will auto-generate an image based on some variables in the post the user is writing. They have the ability then to set some colors and stuff to make the image look nice. ...
0
votes
1answer
8 views

Thumbnails are hard cropped not matter what

I'm using WP Job Manager, and would like user-uploaded logos to be resized and positioned to fit within a fixed height and width. Currently, my settings are at: When I am uploading the following ...
0
votes
0answers
21 views

RSS media:content image to Featured Image

I can see lots of plugins and solutions for embedding a featured image into an RSS feed, but what I want to do is take an image that has been embedded in a feed and make it a featured image when the ...
1
vote
1answer
21 views

How check that there is post thumbnail feature image or not on wordpress?

On my wordpress site , I have some post that all of them have post thumbnail, but their post thumbnail removed from host and now when i want to load them on site , there is no image for loading to ...
0
votes
1answer
24 views

How to link all featured images to custom url in single.php for only non-logged-in users?

I want to link featured images of every WordPress posts to specific page/url for only visitors (non-logged in members). And this function should be disabled for logged in users. It should only link ...
0
votes
2answers
21 views

Images are randomy deleted from server

I've got a bizarre problem with a website I'm working on. Recently, when anyone uploads images to the site, some time later (maybe an hour, sometimes several hours) one or more images disappear ...
0
votes
0answers
17 views

wp_get_attachment_image_srcset returns false for CPT

I have created a CPT function create_themes_posttype_raihan() { register_post_type( 'themes', // CPT Options array( 'labels' => array( 'name' => __(...
0
votes
0answers
17 views

WordPress on CentOS automatically generate featured image 300x300 , but WordPress on Windows keep original image size

I am using WordPress 4.6 , WooCommerce . WordPress on CentOS automatically generate featured image 300x300 , but WordPress on Windows keep original image size. Same source code, on CentOS 7 on ...
0
votes
0answers
37 views

Thumbnails regenerate wp_generate_attachment_metadata

I'm importin pictures via FTP and create custom recorss in mySQL via insert. I'm trying to make a cron job to regenerate thumbnails. This is what i came up to.. but i doesnt work. add_action( '...
0
votes
1answer
28 views

All Images not calling alt text

I am having trouble with the alt text on my wordpress.com website. I am using a theme I coded myself. From what I recall, if I added alt text to an image in the Media Library it would insert into the ...
0
votes
1answer
21 views

Issue with wordpress thumnails - same thumnail displayed everywhere

I have this piece of code <?php $loop = new WP_Query(array('post__not_in' => array($latestId),'post_type' => 'post', 'posts_per_page' => 9,'paged' => ( ...
1
vote
1answer
19 views

Including post thumbnail url in loop's post object to reduce number of queries

I'm working now on high performance Wordpress website and it requires me to analyze a lot of queries, caching options etc. I've discovered that if you use get_the_post_thumbnail() even within the loop,...
-1
votes
1answer
24 views

Show thumbnails 1-12 of category x on any given page

Using wordpress twenty nineteen, I checked the forum but cant find this same question. I would like to display the 12 most recent posts from category x, using just a thumbnail of the featured image ...
0
votes
1answer
20 views

display WP image posts in Bootstrap 4 modal

I have a series of image posts displayed on a page of a WP site that uses Bootstrap 4 _ The link to the development site is also online here The images normally display in a larger size when they're ...
0
votes
0answers
9 views

How can I hook to the thumbnail creation function and create an additional image in other folder?

I need to create the "retina" image with 2x width of each existing image in the folder "uploads" to the folder uploads/scaled. like this: image_resize( string $file, int $max_w, int $max_h, bool $...
0
votes
0answers
14 views

Featured image size always cropped bottom

Good day! I am trying to add a featured image to my post but every time I add a featured image, the lower part gets cut off. Original size is 300x300 pixels. If the windows size gets changed, ...
0
votes
1answer
29 views

How enter custom post meta or custom field on box post list archive page?

I ask a question that I think many people are interested in knowing the answer. What I really can't do with wordpress is to insert custom meta or dynamic custom fields into the post boxes (on the ...
0
votes
1answer
34 views

WordPress set featured image to first image of the post

I have tried every solution from similar answers and nothing seems to work on Wordpress 5.0 + When saving a post I want to set its featured image to the first image in the post content. function ...
0
votes
2answers
52 views

Fallback default image when there is no featured image

I have tried many options but without luck. It should be very simple approach but does not produce results. I am trying to insert default fallback image if there is no featured image in the post. My ...
1
vote
1answer
21 views

Create thumbnail size only for a few images?

I have a few posts that require their thumbnail sizes to be 1000x430. If I register this size and regenerate the thumbnails, it will create this size for all images in the media folder, if I'm not ...
0
votes
1answer
34 views

Using featured image of blog archive page

On my custom wordpress theme, I am using the featured image thumbnail for all of my pages to be the header of the page. I've created a page called "blog" and using it as the archive ( via settings ->...
0
votes
0answers
18 views

Multiple Post Thumbnails Not Returning URL for Background Image

I've been using the Multiple Post Thumbnail plugin with my custom post types to use a secondary, smaller image on my archive pages, while I have a larger hero image in the header of the single post (...
0
votes
1answer
33 views

Remove Featured Image & All Media Uploaded to the Post

I found a solution of removing featured image related to the post when delete the post from this article but, I want to remove all the uploaded media also with post removing. Delete all WP image ...
-1
votes
1answer
15 views

Auto post creation

I've a problem in wordpress that I find automatic posts getting created.. I couldnt figure out what is causing that.. Is this can be from a plugin? You can see in the picture an example of those posts ...
0
votes
0answers
49 views

How to programmatically set existing image in media library the featured image for a post in wordpress

I have uploaded some images to the wordpress media library. Now I am going to create some posts using php and want to use those already uploaded images as featured image for these posts respectively. ...
1
vote
1answer
41 views

How can I add a “data-pin-nopin” the featured image html?

I really want to prevent my featured images from being pinned. It seems so simple but I just don't have the knowledge to do it apprently. I found this but it doesn't work. I have divi theme if that ...
0
votes
0answers
9 views

Smush Featured image constraining in image file that is being loaded on page

I added Smush - what a mistake. Somewhere, it is changing which image is being loaded in the featured image spot, not by image compression but by loading the appending 1024x768.jpg string to the image ...
1
vote
1answer
80 views

Change WordPress image URLs via filter

I'm planning to create a wordpress plugin that will offload uploaded images to external website and show them from there. What I did so far: 1) Whenever a images gets uploaded, my custom functions ...
0
votes
1answer
19 views

how to post default thumbnail if post not created yet

I want to show a default thumbnail if a custom post not created yet. Here is my loop: <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> <?php if ( ...
0
votes
1answer
38 views

add_theme_support post-thumbnails not working

I tried to add thumbnail support to my theme add_theme_support( 'post-thumbnails', array( 'post', 'page', 'service', '100', '90') );
0
votes
0answers
10 views

Need differrent images for Thumbnail and Feature

I need different images for thumbnail and featured image. Feature image will be shown only at the time of reading (on top of the post); Thumbnail will be shown everywhere except inside my content. ...
0
votes
1answer
90 views

Set featured image from auto generated video thumbnail url php

// Set video generated thumbnail as featured image*** if(isset($posted_data['video-file']) && $posted_data['video-file'] != ''){ //Wait 10 seconds for thumbnail to be generated ...
0
votes
1answer
23 views

Having trouble with customizing blog posts on the home page

I can't seem to get this right. I am trying to load in the 6 most recent blog posts (2 rows, 3 columns, responsive). The post title would appear on top of the thumbnail image. Here is the design ...
0
votes
0answers
26 views

Automatica crop image in wordpress 5.1?

original image size 777x518 when uploading this image it shows only 575x416 in WordPress 5.1. It automatically crops this image.I want, When uploading an image it will display your original size. How ...
0
votes
1answer
142 views

get_the_post_thumbnail_url('full') returns empty from custom post type

I'm trying to display the full size image of the single post from a custom post type that I created, below is what I've tried <?php $args = array( 'post_type' => 'press', 'order' ...
0
votes
0answers
65 views

Displaying product thumbnail category on hover in menu

I need a submenu like this one: https://www.groupelacasse.com/ (products submenu) Where there's an image and products category. When a category link is hovered, its category thumbnail is displayed ...
0
votes
0answers
16 views

Post Thumbnail: Is there a possibility to add a description to the meta box? [duplicate]

Probably many of you are using the Post Thumbnail feature: https://codex.wordpress.org/Post_Thumbnails I wonder if it is possible to add a description to the post thumbnail meta box in the admin area....
0
votes
0answers
11 views

Post thumbnail not working when previewing post

In my theme, thumbnails are working just fine for the most part. But when I preview a post by clicking the "Preview changes" button, about 3/4th of the thumbnails on the page are broken. When I test ...
0
votes
0answers
29 views

Blog featured images disappeared on my homepage

I am quite new to this but I edited and updated a website which has the blog area on the homepage. The website is a one page website and the blog area is also called 'News'. The blog was yet still ...
0
votes
1answer
32 views

How do I link a featured photo to it's post?

I cannot change the url of the photo in the featured-image edit section. The page can be found at https://irregularus.com/tips-and-stories/ and if you click on the picture you will see that it just ...
-1
votes
2answers
73 views

Display featured image metadata?

Display featured image file size, extension, filename, type, orientation? How to display some information of featured image in post. I need to display like this in post: Detail Of Easter Desktop ...
0
votes
2answers
19 views

How do I change the size of the feature picture of a single post?

Every time I select a featured photo for a single post, the size is always adjusted and it's massive. I have changed the size of the photo within WordPress, outside of WordPress, added code to ...
0
votes
0answers
139 views

Add second featured image to a custom post type without plugin

I want to show on hover a different featured image for some wordpress custom post type. I don't want to use a plugin, this because I want to learn how to use the wp API natively. Is there a way to ...
0
votes
2answers
26 views

Display Random Posts with thumbnail instead of just a title of the post

This code works really well. It displays the title of the post randomly with permalink but my objective is to display the thumbnail and/or featured image instead. Any help would be appreciated. <?...
0
votes
1answer
29 views

featured image metabox not moving custom post type

I am working on theme development and I have to move my featured image metabox so that it is more user friendly. I searched for move featured image metabox. Thanks Allah for I have found the ...
0
votes
0answers
23 views

Auto select a Featured Image based on post title + image title

Looked everywhere with no luck. How can I, using a function, assign a picture in my media library as a Featured Image for a post by matching their keywords? In other words: We post an article. We ...
1
vote
2answers
82 views

Change post featured image on hover

I've almost finished my first custom theme for a website. I've created some custom post type to manage a portfolio and a staff member section. No problem with the code, but the client asked if is it ...
0
votes
0answers
16 views

Plugin to play music and video by click on thumbnail

Is there any way to do something like this this I use the blow code but it does not work on my theme(jannah) /*-----------------------------------------------------------------------------------*/ # ...
0
votes
0answers
78 views

Force WordPress to strip/remove EXIF/IPTC metadata when resizing thumbnails

I am using Imagick with WP 5.0.3. Since version 4.5 WordPress use Imagick to create/resize thumbnails and it keeps EXIF/IPTC metadata (using GD, metadata are removed). WordPress keep EXIF/IPTC ...