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
10 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
16 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
6 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
15 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
9 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
26 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
11 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
20 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
87 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
10 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
7 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
20 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
25 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
14 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
11 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
8 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 ...
0
votes
0answers
12 views

Can't identify why code can't get attached images thumbnails urls

In my functions.php i'm trying to get the 'small' (thumbnail) urls of all the images attached to a post: $post_id = get_the_ID(); $images = get_post_meta( $post_id, 'user_images_upload' ); ...
0
votes
0answers
9 views

How can I create or edit posts in bulk with featured images?

I am changing the structure of my site in a way that basically requires me to recreate every post. I have been looking into bulk post creation tools but the ones I find only let me set up a title, and ...
2
votes
1answer
50 views

Get image of latest post from taxonomies/categories

I have a custom post type "Artworks" with a custom taxonomy "Artists". I have a page where I list all the entries from the "Artists" taxonomy (Artist 1, Artist 2, Artist 3, etc.). How can I get the ...
1
vote
0answers
44 views

Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type

For a Wordpress project I made a Custom Post Type in the usual manner. Also i made a custom role. I want users with that role to be able to make, edit and delete this CPT. I added the apropriate ...
0
votes
0answers
22 views

Control responsive image size in WooCommerce

My WooCommerce thumbnail has been set to 400px width. However 400px width thumbnails are loaded only in laptops having 720p display. In laptops with 1080p screens, the thumbnail loads at 768p and ...
1
vote
1answer
54 views

Featured Image .svg height and width 1px only

I need to create a custom type post where will be added the name of the client and its logo. The logo will be added as a Featured Image. But the problem is that Wordpress does not recognize the SVG ...
0
votes
0answers
25 views

How to delete original image file after upload and resize

When I upload an image named image.jpg, Wordpress creates image-150x150.jpg. How can I delete image.jpg and keep just the image-150x150.jpg in function.php, because I want to optimize my disk space ...
0
votes
2answers
252 views

Using Gutenberg block components in admin interface controls

I asked a previous question, and got a helpful answer that got me going quite a ways. The present problem is unrelated, but IMO reflects the dearth of documentation suitable for those of us who aren't ...
0
votes
0answers
23 views

attachment_fields_to_save first parameter is null

I have the following code in a self-written plugin. In the function saveHomepageGalleryCheckbox the first param ($post) is always null. Did I something wrong? The second parameter ($attachment) has ...
0
votes
0answers
11 views

place to add the_post_thumbnail for homepage for news-pro child theme

Disclaimer: new to php & wordpress Been puzzled for a few weeks now how news-pro child theme creates homepage so i'm just hoping to get some pointers here because I can't seem to find the correct ...
0
votes
0answers
24 views

How to exclude 150*150 Image to set as a thumbnail?

The size of the first image of each post of the feed that I am importing is 150*150. Theme always set first image as feature images so the all thumbnails are looking blurry. Is there any custom css or ...
0
votes
0answers
26 views

Bad srcset for hard-cropped thumbnails (wp_get_attachment_image_srcset)

(Sorry in advance for the English translation, I tried to do my best, it should be understandable.) I've been looking for a long time but I still haven't found the solution to my problem. I want to ...
0
votes
0answers
20 views

How to create blob url from wordpress post thumbnails

I wanna convert the post thumbnails to a blod url, this because I have a website where I need to hide the original wordpress uploads path. Normally I use the the_post_thumbnail_url() function inside ...
0
votes
2answers
30 views

cropping post thumbnail without falsing them to crop to dimensions

am trying to crop my thumbnail in my loop, am having some problems when i crop using codes some images appear either big in width or height here is my code Css .imgholder {float:left;margin-right:...
0
votes
1answer
39 views

Should I not compress my jpeg files before uploading to avoid double compression?

Wordpress compresses jpeg files to a lvl 82 quality. Should I upload my files in 100 quality to avoid double compression? Or will Wordpress know the file is already compressed and will skip this ...
0
votes
2answers
32 views

How to add Wordpress Featured image in <a> tag ..?

I am trying to add Wordpress featured image in tag. I used these 3 shortcodes. <?php echo $image_large[0]; ?> <?php echo get_the_post_thumbnail(null,'thumbnail');?> <?php echo ...
0
votes
1answer
39 views

Set featured image as hero image on each page

I want my post's featured image show as a full width hero image. I have tried to set the featured images as background images in a full-width row, but I think it is not possible. If anyone have the ...
0
votes
1answer
35 views

Get featured image from post on RSS feed

I want to add the featured image to my RSS feed. function rss_post_thumbnail($content) { global $post; if(has_post_thumbnail($post->ID)) { $content = '<p>' . ...
0
votes
1answer
47 views

automatically set random featured image by category in wordpress on post

Basically I want to automatically set an image randomly from a selection of about 3 or 4 images in my Media Library when someone posts a blog from a particular category. I've got this so far but it ...
0
votes
0answers
14 views

Is there a way to enhance image uploader with crop option?

If you use one of the default themes you might find that the custom header upload or logo uploader in customizer allows you to crop right in upload screen. Is there a way to do that in all upload ...
0
votes
2answers
20 views

Custom recent-posts shortcode's thumbnail image not in line with rest of code

I'm making a custom recent-posts shortcode and I have a problem with the thumbnail image, it always shows it above everything else (permalink, title, etc...) even though I put it after in the code, is ...
0
votes
0answers
13 views

How to display a choice array of WordPress posts plus their corresponding featured images

I found a lot about displaying related posts but I can't control which posts I want included. I would like to display a specific list of post titles of my choice along with their corresponding ...
0
votes
1answer
28 views

How to display featured image description and title?

I'm displaying a featured image (as a background) in a hero div, and using the caption to add some content from the Media Library automatically. I'd also like to use the image's description field and ...
0
votes
2answers
25 views

An error has occurred during the upload process in wordpress version 5.3.2

I need your help , i try upload to wordpress an image but there is error ‘An error has occurred during the upload process in wordpress’ , please help me find solution. ASAP Note : this website http://...
1
vote
0answers
19 views

How to stop thumbnail generation from some images and different size thumbnail generate

I have 4 Post Type, and each Post Type has images with different size. Is it possible to choose not to create thumbnail images when uploading an image or to create specific images size for each post ...
0
votes
2answers
93 views

Generate images to be associated for tag and category?

I’d like to generate images suitable to insert into metadata (like Open Graph or twitter:image). Basically I want to create a collage based on posts for each tag. So let’s say I had the tag “cats” ...
1
vote
0answers
31 views

Can you put a condition on add_image_size() depending on the width of the uploaded image?

I just started to optimize the auto-scaling of images i upload on my wordpress (via Media tool). I added the desired set of custom sizes, which are working just fine. In example : add_image_size( 'og'...
0
votes
1answer
74 views

Import 2000 posts from one website to another

I need to import 2000 posts from one website to another. Posts doesn't have any custom fields. We need to import title, content, featured image, slug and language. For language I am using Polylang ...
1
vote
0answers
13 views

Update old Post image metadata to 'thumbnail' wp_attached_file

I am updating a very old WP-based website that was created prior to WP use of "featured images" aka thumbnails and the name of all post images are contained in a custom meta-field called "Image" (...
0
votes
1answer
11 views

How to show Thumbnail size, caption, extension in WordPress?

How to show Thumbnail size, caption, extension in WordPress??

1
2 3 4 5
30