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
13 views

Display posts flex while keeping original featured image aspect ratio

I am displaying recent posts in a row. The featured images have different aspect ratios (some are landscape, some portrait), and I'd like for the images to keep their aspect ratios and for the whole ...
0
votes
1answer
21 views

wp_query - Exclude the first thumbnail from lazy loading on archives

I have a function that change loading="lazy" to loading="eager" from the first thumbnail in categories and tags. The problem is that this function removes the post thumbnails from ...
0
votes
0answers
14 views

Random featured image in folder with twenty twenty tempalte cover

For one of my wordpress site on a child theme of twenty twenty, I would like to randomly display a featured image (pre-selected in a folder) which changes with each load eg of the page. I succeeded in ...
0
votes
0answers
30 views

Feature image does not displaying in backend [closed]

I know this question have been asked a lot of times but I test all the answers found and it does not work. I have not the "featured image" block in my wordpress admin. When I create a post ...
0
votes
0answers
24 views

Using the admin Featured Image's modal in the front end

I am trying to get the new upload frame of the featured image used in the admin side, but the one used in the front is different. I will show you some screenshots: In the admin section when I click ...
0
votes
1answer
21 views

Which filter fires upon setting a featured image

When I am creating/editing a post and set the featured image, I’d like to display a message to the screen if the file dimensions or size are below a certain threshold. But I want the featured image ...
1
vote
1answer
16 views

Setting fallback (default) image to featured image block

I was trying to make a block based theme and encountered a problem trying to set a default featured image in case some posts do not have them. Basically, we used to do this in php <?php if ( ...
0
votes
0answers
10 views

insert og image link in wordpress post

I am trying to extraxct the og:image url is there a wordpress plugin that extract og:image url from an external webpage url i need a shortcode to insert that image in my post
0
votes
2answers
21 views

Thumbnail is showing outside its div instead of inside it

I'm echoing the post thumbnail here: echo '<div class="post-image right">' . the_post_thumbnail('featured-portrait-large') . '</div>'; And it works, but it's outputting the ...
0
votes
2answers
86 views

WP is showing wrong image dimensions

Several times over time I changed sizes of thumbnails WP generate when images are uploaded, always setting bigger size. Recently I set Thumbnail Width 600px width and Medium size Max Width 1800px. ...
0
votes
1answer
40 views

Recent posts on homepage: different thumbnail based on logged in status and post category

This works well on archive.php, but not working on the homepage. For some reason, the first statement doesn't get applied: if a post is in Members category and user is not logged in, it's supposed to ...
1
vote
1answer
20 views

Featured Images Not Loading In Blog Archives

A client running a custom theme recently updated their WordPress version from 5.2.7 to 5.7.1. After this update, featured images in blog archives are no longer loading. The theme has been updated to ...
0
votes
1answer
52 views

Display related posts without a plugin

I'm trying to display the related posts using functions.php: function posts_related($related){ if (is_single()) { global $post; // Build basic custom query arguments $custom_query = new WP_Query( ...
0
votes
0answers
15 views

Show categories when upload a featured image

When you upload an image in the media library, you can add categories in the process. Is it possible to show categories when you are editing a post and add a feature image. In this case, when you ...
0
votes
0answers
13 views

Default Featured Image only shows on single post page

so I would like to set a default Post featured image / thumbnail. I tried using this code in the post loop in the loop.index, but that only showed the default image in the single post pages and not on ...
0
votes
1answer
23 views

default post thumbnail and category if there is no thumbnail and category

I want to do following... 1 - Publish the new post, 2 - Check if this new post has a featured image, 3 - If it has not a featured image, define its category and save the specific prepared image as the ...
0
votes
1answer
33 views

get_the_post_thumbnail_url does not return anything if image size is set

I want to display the post-thumbnail image in the header using get_the_post_thumbnail_url() with defined size, however if I am using it without specifying the size, like get_the_post_thumbnail_url() ...
0
votes
1answer
44 views

<?php the_post_thumbnail_url('medium'); ?> not outputting medium size image URL

I am currently trying to output post thumbnail URL with its different image sizes; to use in ssrcset. My current code is: <img class="productimage lazyload" data-src="<?php ...
0
votes
0answers
9 views

How to set the featured image / page thumbnail from php template?

I added a template php to my Wordpress site, showing a basketball image from url, I'd like this to be the thumbnail of my website when sharing on social media My php template- <?php /* *...
0
votes
1answer
44 views

How to add a default predefined thumbnail when creating a brand new post?

I'm making a plugin that has a custom post type and I need to add predefined content. I used filters default_title and default_content for the title and content but I can't find how I can add an ...
0
votes
0answers
31 views

Change featured image lightbox image size to full size

So i made a blog with posts with image galleries, and i would like to make the featured image lightbox full size instead of the smaller size it is now. I already did this with the images in the ...
0
votes
0answers
14 views

Display Author avatar as featured image

Does anyone know how I can display the post author avatar as the default featured image for posts? Thank you
0
votes
0answers
10 views

How would I center the featured image position on a post?

The featured image us left aligned and not centered, and on mobile view does not look good. How can I customize the way the featured image banner looks?
1
vote
0answers
20 views

Duplicated featured image is not showing

I have a site where I upload Apkmod file that's why I have to upload dozens of post daily but some time by mistake I upload the same post with the same feature image and I don't want my site work ...
0
votes
2answers
119 views

PHP variable = get_the_post_thumbnail_url outputting without slashes

In a custom shortcode function, I'm grabbing the featured image URL: $text_slider_testimonial_img = get_the_post_thumbnail_url($single->ID); If I echo $text_slider_testimonial_img immediately I ...
0
votes
1answer
21 views

Blog replace single post page featured image

i made a blog and now i want to fix the issue if somebody doesn't add an image to use as the thumbnail, I want to use a default image. I did find a plugin that fixes that, but i would like to change ...
1
vote
0answers
19 views

Using featured image from another page

I have the following code which, if a page is a sub-page of 'Portfolio' (ID 12), will use the featured image of the Portfolio page rather than it's own. However, I also have a page of 'Services' with ...
0
votes
1answer
25 views

wp_get_attachment_url not fetching URL?

the below code does not seem to return an image url at all, chrome inspector says source is unknown foreach ($subcategories as $subcategory) { $link = get_term_link( $subcategory->...
0
votes
0answers
11 views

How to change the featured image / post thumbnail size on category / archive pages?

I am trying to figure out how I can change the size of the featured images on category and archive pages on my WordPress website using a custom theme. In my functions.php file, I have added the ...
0
votes
0answers
15 views

Resize thumbnail in elementor hello theme

Absolute beginner, need help trying to resize my thumbnails in elementor hello theme. Elementor say its a theme issue, yet its their theme ! I have tried css custom codes to no avail.
0
votes
1answer
18 views

Removing extra large generated images disables all crops

function filter_image_sizes( $sizes) { unset( $sizes['1536x1536']); // disable 2x medium-large size unset( $sizes['2048x2048']); // disable 2x large size return $sizes; } add_filter('...
0
votes
0answers
16 views

Generate thumbnails with HTML overlay with PHP

I want to generate sosial media image with an HTML overlay. So in simple terms JPEG thumbnail + HTML overlay = JPEG output. Example, I have an light image without text on it, then I add an dark ...
1
vote
0answers
24 views

Media Gallery Upload photo incorrect way like glitch

I start having this issue like 3 days ago, I disable all plugins but nothing works. See the examples: Original photo: after I upload:
0
votes
0answers
16 views

Thumbnail (featured image) and Media Library cleanup queries help needed

I inherited a website that was started 13 years ago, over the years the version of WP and themes have been kept current, however much of the older content (and there is a ton of it) was created long ...
0
votes
0answers
29 views

How to make product image inherit from category image

I'm planning on importing large amount of products and automatically assign them to certain product categories(in woocommerce). I have 5 different categories and want for each product in each of those ...
0
votes
1answer
13 views

How is called this thumbnail slider feature

I am new to wordpress, and I am trying to create new website. I found really nice-looking theme, but when I installed and activated it, it looks very simple compared to the preview page. Is it due to ...
0
votes
0answers
23 views

Get ACF Sub-Category image from loop

I'm using ACF to assign a category image to sub categories. Parent category-(contributors) > Sub categories-(contributor name). All my posts have multiple category and sub categories selected but I'...
0
votes
0answers
16 views

Adding an optional page title with background image to custom page templates (or all pages for that matter)?

I will explain what I’m trying to accomplish as I am having a difficult time figuring out the best way to ask this question. I have a custom theme that I am working on. I have several custom page ...
0
votes
0answers
17 views

Change featured image when changing viewport

I have a featured image linked to my page. In my page template, I have: <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> I want that the featured image changes when I ...
0
votes
0answers
26 views

Make 1st Slide of PowerPoint file to be the Post thumbnail preview image

I'm building a website for a client.. The website will only accept PowerPoint files to be uploaded in our server by our future members and soon we will start accepting online links.. I would like to ...
0
votes
0answers
28 views

Issues with wordpress watermark

I'm adding a watermark to a WordPress featured image of a post submitted by me by clicking on a button on the front end which is visible only to the person who submitted that post. That button calls a ...
0
votes
0answers
8 views

How to show gallery in image attachment page?

And how to show all images from article/post at the bottom of this image page (plus NEXT, PREV button)?How to show gallery in image attachment page? Demo here
0
votes
0answers
87 views

Use WEBM file as post thumbnail or “Featured Image”

I have run into an issue that I've been trying to solve for a few days now. I have some .webm video files for web stored away from my WordPress installation. Previously, I was using the Post Type->...
0
votes
0answers
6 views

How to Add call button on a featured image in a wpsite? check the slap king image, there are two buttons on the featured image

I want to add 2 buttons on the featured image of my WordPress pages. Kindly help me out.
1
vote
1answer
33 views

How to stop twenty fifteen theme from cropping featured images?

The twenty fifteen theme always crops featured images, it cuts from both lower and upper part of the image usually. How to prevent it? How to show the normal (full) dimensions of featured images? In ...
0
votes
1answer
29 views

Replace background image with post thumbnail in shortcode

So, I'm trying to pull the featured image of posts in via a shortcode. But I want to replace the inline style of setting it as a background image and have it returned as an img tag instead. <?php /...
0
votes
2answers
36 views

Resize post thumbnail

I'm trying to ensure that all assets are the same size, no matter what resolution they are uploaded in. I'm stuck finding outdated info on the matter, I think. I've gotten to the following snippet if( ...
0
votes
0answers
14 views

Remove Post Title from Thumbnail on homepage and archive

I am trying to show only thumbnail images and not title on Homepage and Archive pages. Attempted Removing Title Tag from Thumbnails but not working for me. Any help will be an obligation!
0
votes
0answers
28 views

broken image in WordPress thumbnail

My Thumbnail are like this image and my thumbnail are broken. Please help me. Here one of my thumbnail.
0
votes
0answers
14 views

How to delete all images from post with selected status?

Need to delete images: thumbs, meta_key = _thumbnail_id attached images. For example meta_key = 'image_upload_9860026864', I don't know what the digits at the end. Inside a:3:{i:0;s:6:"126306&...

1
2 3 4 5
32