I have a custom field for an image, and using it this way: <?php $item_img = get_sub_field('image'); ?> <img src="<?php echo $item_img ?>" /> But I want to use the thumbnail version of the image, as set to 150x150 in wordpress. How do I do that with this type of setup? Do I have to set a custom add_image_size() or does wordpress have duplicated thumbmail size images?
I would like to crop in particular dimensions but I need that to be done on both height and width of the image. Here is a small illustration of what I am trying to do: When I try to use this snippet: add_image_size( 'custom-thumbnail', 160, 160, true); or even add_image_size( 'custom-thumbnail', 160, 160, array( 'center', 'center' )); it only crops the horizontal side and so this is what I get: And this is what needs to be achieved: Is there …
I have a theme with woocommerce. Some products have more than one photo, and when user hovers over such products, those photos (that are in the photo gallery) will rollover. I want to make the product image clickabe to do that I've used this code, and added to functions.php if ( ! function_exists( 'woocommerce_get_product_thumbnail' ) ) { /** * Get the product thumbnail, or the placeholder if not set. * * @subpackage Loop * @param string $size (default: 'shop_catalog') * …
Looking to discover how to alter my content.php code to add the thumbnail image of the specific posts to my search results located here for example: https://divesummit.com/?s=suunto&submit=Search I would like a thumbnail of the featured post’s image listed along with the smaller blurb of the post in the search results. <?php get_template_part( 'content', get_post_format() ); ?> by somehow changing content.php I can have it include a small thumbnail along with each search result. My theme already has thumb support I …
Wordpress doesn't generate thumbnails in my server. I don't know why. Old images' thumbnails get regenerated; however, the newly uploaded ones doesn't. I used Regenerate Thumbnails plugin to regenerate all the thumbnails. The new ones doesn't regenerate. It gives me error "The error message was: Unknown failure reason." I have checked everything. I have GD enabled in php.ini and the directory is writable. What else should I check?
I am using custom metabox for a page in my new project, I am using it for uploading image, and attaching it to the page. It's working fine, I can select image or upload the image using WordPress' native uploader, and attach it. The issue is that I am getting the large size image only. What happens is I have to resize it by specifying its width and height. Is there any way to get the other sizes of the …
When I upload the image, it is https://www.mywebsite.com/wp-content/uploads/2022/03/image-name.jpg After I set it as a featured image, it is like: https://www.mywebsite.com/wp-content/uploads/elementor/thumbs/image-name-pbpc1q6exttjkxpm1we8ytyicduwun0uk12ffhoguk.jpg Why it doesn't show its original URL? Anyone can help? Thank you.
I have one Product Category that needs to have 300 x 300px uncropped thumbnail images. All of the other products have 300 x 300px, cropped thumbnails. This would be on the Shop page and the Category Pages. The category is for Books and the cropped image cuts off the top and bottom of the book cover. All of the other product categories look best with a square cropped image. I added this code to my functions.php file, but it has …
In my theme there is a set of add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 470, 680 ); which is actually generating one more image besides the default small,medium,medium-large,large and it is set from the author of the theme for specific purposes of course. I am using the wp_insert_attachment() default function for uploading image from front-end. From only this specific procedure i don't want the generation of multiply images.Only the original image and the thumbnail image. So i made this simple code function …
I need to duplicate a list of thumbnails elsewhere on a page and have set up a few different custom thumbnail sizes in my functions.php file. If I use: the_post_thumbnail('photo-small'); Then the thumbnail gets displayed correctly, if I use: echo get_post_thumbnail('photo-small'); Nothing gets echoed - it's an empty string. What I am trying to do is add the generated img tags to an array so that I can loop through it outside of the loop but for some reason it's …
I have installed all the required extensions like ImageMagick, Imagick, and Ghostscript. I used a plugin to test the requirements and everything passed. ImageMagick: Installed Imagick: Installed Ghostscript: Installed WordPress >= 4.7: Installed GPL Ghostscript 9.27 (2019-04-04) But for some reason, WordPress does not generate thumbnails for PDF files while uploading them directly from the media manager or from the post editor. I also tried using the Regenerate Thumbnails plugin but it did not scan for the PDF file. I …
I have a problem with the thumbnail I setup Customizing ▸ WooCommerce ▸ Product Images The desktop page version shows a smaller thumbnail and the mobile site show the biggest version, Google page speed I got bad results because the mobile site is bigger than the desktop. Category grid view have 100 pictures and too mutch size So way working opposite? Mobile site version picture size 68 Kb. Desktop site version size 41 Kb. Somebody can check reakiroshop.eu enter image …
I want caching all images on my site and prevent the browser download the images all times, so I would like add an version query tag to all images (for example: ?v=20160505) How can I add this for image urls? Now I use this code to show images in my theme: echo get_the_post_thumbnail( $thumbnail->ID, 'thumbnail' );
I have created a WordPress plugin to create a widget area to display category names (total nmbr of post) and description.Now I want to show the category image just after the category name and after the image I want to show category description. Although category names and description display successfully I just want the complete code of how to add feature image to category and how that will display in my category description widget area. For Reference here is my …
All I want to do is get Wordpress's featured image XML code to use a jpeg link as the meta_value, instead of the image gallery data-id number. Basically change this code: <wp:postmeta> <wp:meta_key><![CDATA[_thumbnail_id]]></wp:meta_key> <wp:meta_value><![CDATA[202466]]></wp:meta_value> </wp:postmeta> To something reading like this: <wp:postmeta> <wp:meta_key><![CDATA[_thumbnail_id]]></wp:meta_key> <wp:meta_value><![CDATA[http://xxxx.com/wp-content/uploads/xxxx.jpg]]></wp:meta_value> </wp:postmeta> I appreciate the help, hopefully its something simple enough.
My default media setting in WordPress blog is 150x150, 300x300, 1024x1024 respectively for thumbnail, medium, large images. Now I am designing a theme that need different size thumbnail images to show in theme. For this, I go to the media setting again and changed the setting with my news sizes like 72x72, 250x250, 400x400 respectively for thumbnail, medium, large images. But now to resize my old uploaded images, I used Regenerate Thumbnails WordPress plugin and that generated my new media …
I've been looking around the net for a long time on how to disable WordPress from creating multiple thumbnails. I've seen in most tutorials to set all the images to 0 in the media section. I have done that, but going to my uploads folder and it still creates multiple images. I can't find any solution for this. The reason I want this is to save space on my host account.
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' => 'ASC', 'post_status' => 'publish', 'suppress_filters' => false ); $press = new WP_Query( $args ); if ( $press->have_posts() ) { ?> <?php while ( $press->have_posts() ) : $press->the_post(); ?> <div class="col-sm-4 mb24"> <article class="post-article bg-white"> <div class="article-img"> <?php if( has_post_thumbnail() ){ ?> <div class="img-box position-relative overflow-hidden"> <a …
I am creating my custom Image slider, in register_post_type() -> i use : supports = "title,thumbnail"; i use only two thing in supports, "title,thumbnail" But post-thumbnails default position is Under Publish tab. Its look ugly, I want to show feature image Under title fields. Where editor show, i want to show my feature image on that position. Kindly tell me how this possible? $args = array( 'labels' => $labels, 'description' => __( 'Description.', 'textdomain' ), 'public' => true, 'publicly_queryable' => …
My wordpress theme uses get_the_post_thumbnail() to display Thumbnails on Posts. I have set custom image sizes but running it through Lighthouse gives following error. Serves images with low resolution Image natural dimensions should be proportional to the display size and the pixel ratio to maximize image clarity. My innitial approach was to set Serves images with get_the_post_thumbnail($ID, 'large'); This effects my largest contentful paint and increases page size, thus impacting my performance. I need to strike a balance. So is …