Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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
0answers
10 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
20 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
21 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
20 views

Show Featured image and 5-6 secondary images of posts on wp blog homepage

I am creating a travel video blog and I want to show the featured image and some shots from the video on home page. I saw this on another website but I am trying to replicate that on wordpress. Here ...
0
votes
0answers
13 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
29 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
13 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
21 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
10 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
36 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
19 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
23 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
46 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
9 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
31 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 ...
0
votes
0answers
16 views

Custom post thumbnail image not working anymore

This page shows thumbnails for custom posts, but it's not working with new posts: http://jmldesigndev.com/swss-02/about-us/meet-our-providers/ Here's the code that pulls the thumbnail, but I don't ...
0
votes
0answers
9 views

Is there an after or before_remove_product_image hook?

I am using WooCommerce and want to change some custom meta for the product thumbnail when it is unattached, so I searched everywhere for an action that fires when you "remove product image", or ...
1
vote
1answer
16 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
0answers
12 views

How to create a featured image for Wordpress-categories (without Plugin and ACF)

How to create a featured image for wordpress categories without plugin or ACF. Can someone help me? On the next step i want to show a list of categories (with the featured-image) on my homepage. ...
0
votes
1answer
6 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
17 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
0answers
19 views

Thumbnail on First post only on home page in Underscore theme

I am new to WordPress. I have customized underscore theme using latest bootstrap. I have an issue on the front page. On the first post I want to show the post thumbnail and the rest just show a link ...
0
votes
0answers
41 views

Feature Image is not showing [closed]

I am facing an issue with my site in wordpress. I am trying to save a feature image of a post. when I try to save. It is showing me updation failed. I debugged the code. I came to know for below URL ...
0
votes
0answers
110 views

How to get featured image in Gutenberg from a transition_post_status hook?

Before the WordPress 5.0 update, I was able to get the featured image URL from a transition_post_status hook, for posts that are just published, from the WordPress post editor (but not from Gutenberg)....
0
votes
0answers
57 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
15 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;"> ...
0
votes
0answers
41 views

Add hide featured image option

Hello, I wold like to add a check-box or button to have a choice between hide or display featured image in single post. i'm in wordpress 5.0.2 This is the code of my simple single.php in the theme : ...
0
votes
0answers
8 views

programmatically add images to a post that I just added to the media library

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. NucleusCMS adds ...
0
votes
0answers
19 views

Dynamically set front page featured image from first image in latest post's ACF gallery

My front page template is set to display the full content of the latest post using WP_Query and a custom page template. Now I want the home page featured image to dynamically change every time a new ...
0
votes
2answers
25 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
52 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
25 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
27 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 ...
0
votes
0answers
18 views

How can I make the excerpt for a post be the featured image?

I am migrating a blog from blogger (ex blogspot) to wordpress and am looking to take each post's featured image and show it in its excerpt. So, how can I set an excerpt for a post to show the post's ...
0
votes
0answers
12 views

Automatic upload external image and set as featured post

I have a variable that automatic generates the url of thumb from youtube. For example one custom post has $video_thumb_url = 'https://img.youtube.com/vi/' . $matches_1['1'] . '/maxresdefault.jpg'; ...
1
vote
2answers
24 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 ...
0
votes
1answer
53 views

Featured image not shown in twitter post

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
19 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
89 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
22 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
25 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 "Mobile ...
0
votes
1answer
20 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
20 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 ...
1
vote
0answers
160 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('...
0
votes
0answers
17 views

Something in parent theme is preventing child theme from being able to crop images

I have a dilemna where I can't crop images with add_image_size() in my child theme. Instead of cropping, the images are scaled. I've tried all the usual stuff like regenerating images and changing ...
-2
votes
2answers
52 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
0answers
48 views

Get Thumbnail from Page link or Taxonomy Slug

kind of struggling with a task but also writing to see if what i'm doing makes sense. Simple question is I can't return the thumbnail in a foreach loop. Background is I am using a taxonomy to map ...
0
votes
2answers
26 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 ...
0
votes
0answers
26 views

Set featured image from video

I'm working on a Wordpress website and I have created a category for videos. I created an article with video as the format, and I inserted a youtube video in the content. When I view the article, ...