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
1
vote
1answer
309 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
65 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 ...
3
votes
1answer
1k 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
29 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
483 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
1answer
204 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
26 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
1answer
3k 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
19 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
15 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
162 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
34 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
313 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
24 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
2answers
112 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
101 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 ...
1
vote
2answers
525 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
1answer
307 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 ...
0
votes
1answer
57 views

I cannot upload images to post or the media library in wordpress

Whenever I try to upload featured image for a new post or edit featured image of the older post, the following errors comes up: An error occurred in the upload. Please try again later. Here I have ...
0
votes
4answers
2k views

Add second background-image on hover

I'm using my featured image as a background image on a div and I would like to add a second background-image to that same div on hover (I need them both because I want to blend them). Any suggestions? ...
0
votes
1answer
23 views

post thumbnails error

i want to make a wp theme myself almost i do it but there is a biiiig problem and i cant solve it i had add add_theme_support to function and add the post thumbnail in my index but still cant give ...
0
votes
1answer
40 views

Display images of related posts

How do I display related post thumbnails? This is the code that I use: function related_posts_shortcode( $atts ) { extract(shortcode_atts(array( 'limit' => '3', ), $atts)); global $wpdb, $...
0
votes
0answers
58 views

use custom field value as featured image

I know this has been investigated before but no one has given a solution. Besides, I have not enough Stack-reputation to add comments, so I have to ask a new question. I want to use a post's custom-...
0
votes
0answers
14 views

Center crop the feature image

Could someone help me to perfectly center crop the thumbnails(feature image) as showing in the picture
0
votes
0answers
413 views

After migrating media library is not showing thumbnails

We are currently running a script to migrate from a custom CMS to WordPress. Everything is going perfectly well except for the "media manager". The media is all stored on a S3 bucket. Here is a ...
1
vote
1answer
299 views

Add Featured image column into wordpress admin on pages AND posts

I have created a column in my functions.php file to add in a column to see the featured image on posts. However i would like to do this for pages as well, but if i repeat the code replacing posts with ...
0
votes
1answer
40 views

Get thumbnails with array sizes parameter

I am trying to get both full and thumbnail images from post with wp_get_attachment_image_url: wp_get_attachment_image_url( get_the_ID(), array('thumbnail, full')); I know that by default size is ...
0
votes
0answers
16 views

Using the_post_thumbnail do not rollback to original image if specified thumbnail does not exist

We have a series of posts some do not have a defined thumbnail size (i.e. "small-featured"). Right now with the_post_thumbnail() if WordPress can not find that size it replaces it with the original ...
0
votes
2answers
126 views

Get author image from corresponding article in thumbnail

I want to add an author image for each thumbnail-preview on my homepage. I tried <?php echo get_avatar( get_the_author_meta( 'ID' ), 32 ); ?> but it gives me the same image in every thumbnail. ...
0
votes
1answer
369 views

How do I get the featured image to sit below the header in the twenty nineteen theme?

In the twentynineteen theme, the featured image in a post becomes the background of the post. Actually, it becomes the background of the header. I'm trying to get it sit below the header in each post ...
0
votes
1answer
41 views

Unable to display the post thumbnail in the loop

I am trying to create a blog-listing page, that'll display the title and the featured images. Here's the loop that I am using page.php <div class="p-5 container" style="text-align:center;"> ...
1
vote
2answers
1k views

How do I programmatically add an image to a post?

I'm working on converting my old NucleusCMS blogs to WordPress. I have created a set of tables locally and began the conversion process. I've been fine right up to image "conversion". I ...
0
votes
2answers
61 views

Created blank theme for REST API, featured image not appearing on admin side

I have a blank theme purely to redirect to my custom front-end. I created a functions.php and put add_theme_support() inside it and to no avail. index.php: <meta content="0; URL='https://...
1
vote
1answer
64 views

Using concatenate with WordPress Thumbnail

Hi can someone explain me why the thumbnail is showing outside from the div? am i using the function correctly to concatenate the thumbnail inside the $list. BTW im running this code inside a ...
0
votes
0answers
32 views

Can you generate a featured image from two images from custom fields?

Over and over again our blog has the same featured image and all thats changing is two logos. At present we have a blank template we manually load into Photoshop and attach the two images. I have ...
1
vote
2answers
218 views

How to find post with broken image link and delete that post

I have some post in my autoblog that by cronjob mistake the feautured image being deleted. how to find all of that post (post with broken image link) and delete all of it or set the default image if ...
1
vote
2answers
328 views

Change Featured Image / Thumbnail CMS Description

I'd like to be able to edit the description/help text that appears beneath the field in the CMS page editor for a custom post type. I know I can change the name and button/link text by passing items ...
1
vote
2answers
945 views

SVG Featured image not shown in twitter

I have a post with a featured image (size 736x212). The post url is this. I shared my post on twitter, but the tweet doesn't show the image (if you want to check click here). What could be the problem?...
0
votes
0answers
60 views

Missing image size

I have added a couple of custom sizes to my wordpress environment with the following code: add_image_size( "maximal", "1900" ); add_image_size( "desktop", "1400" ); add_image_size( "tablet", "900" ); ...
1
vote
1answer
1k views

How do I use <picture> element instead of <img> tags in WordPress post content having webP support?

I am developing my custom theme and trying to figure out how to modify the default code for WordPress image inserted into the post content, so I could add support for webP format and have it within &...
1
vote
0answers
25 views

How to delete posts that does not have a thumbnail?

I have a problem with my blog. The thing is this, all the posts have a thumbnail in this address: wpbv_postmeta-->meta_key-->thumb And several (A LOT) of posts don't work, because I have made a ...
0
votes
1answer
51 views

Serving a custom featured image for mobile

is it a good approach to serve multiple featured images to have a proper scaling? Right now the featured image size on "Desktop" is up to 1140x250. Pretty wide and will shrink way too far on ...
0
votes
1answer
41 views

How to convert feature image as background image

I am trying to set background image out of feature image so I used the background-size:cover. Here is the code I have done but how can I add feature image into <div class="bg-img" style="background:...
0
votes
1answer
97 views

Images missing from Blog post page

I have created a blog named Tutsguru. When i visit Main page it shows feature images of blog post but when i visit Blog page then images are not shown. I tried different browser but same problem. Can ...
2
votes
1answer
1k views

wordpress responsive image srcset not working

I'm trying use wordpress core responsive image feature but it's not adding srcset to image. Here is th my codes I have a div w=370px h=280px now I added image sizes if(function_exists('...
-2
votes
2answers
163 views

Get Post Thumbnail Outside of Loop

I am trying to get the post thumbnail image for each accordion or show accordion post thumbnail outside of the loop. Currently, it's setup with image empty but I need each thumb to represent the ...
0
votes
2answers
40 views

Is it possible to show thumbnails along with recent post from a wordpress blog on static website's homepage?

Please help me to figure this out that I want to show thumbnails along with recent post from a wordpress blog on static website's homepage. Following code are working fine but I need to show one ...
1
vote
1answer
94 views

Adding Featured Image to Post programatically

How do I add a Featured Image programatically, given the URL/filename of the image, and Post ID associated with it?
1
vote
1answer
603 views

Featured images not displaying at full resolution

The image in my media library is 560×315, but when I inspect the image this is the code I find. srcset images are being loaded instead of my full resolution image. <img src="https://domain.com/...
0
votes
0answers
200 views

How can I use an image from an external source without uploading it to the media library

I am looking for a way to tweak my xml parser code to insert a url from an external source into a new post, instead of first uploading it to the website's media library and than adding the attachment. ...

1 2 3
4
5
31