Questions tagged [images]

Images are used in different ways by WordPress.You can use a theme with images in layout, place images within your post/page content, display images next to visitor's name called avatars etc

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

Hi, Rare Featured Image Error

I have a problem with a website in WordPress. When I create a new post and try to upload the featured image the following happens: The featured image is uploaded to the server, and appears in the ...
0
votes
1answer
40 views

How can I check if the first block is an image aligned left or right?

I need to know if the first block is an image and if it's aligned right or left. I printed the $first_block_attrs variable and can see the output is Array ( [align] => center [id] => 450 [...
0
votes
1answer
3 views

How to display the Media Library Items Upload date

I have a product image catalogue and i'd like to display the Uploaded date of the image: I can see on the media library it displays on-top of the item: Uploaded on: April 15, 2021 as an exmaple but ...
1
vote
0answers
9 views

Every admin only can see his uploaded images im editor

We have a strange problem in Wordpress. Since many months every admin can see only his own uploaded images in the classic editor, when clicking on "Add Media". In the WP dashboard under ...
0
votes
0answers
23 views

Change the URL of an image from wp_get_attachment_image_src for Product Posts based on Category

I would like to change the URL of an image from wp_get_attachment_image_src for Product Posts based on their Category, for example: If a product post is in product category 1, this will be it's image ...
1
vote
1answer
21 views

Change the URL of an image from wp_get_attachment_image_src except in the frontpage

This is the code I used that is working, but I want it to work only on product posts and not on the frontpage. function alterImageSRC($image, $attachment_id, $size, $icon){ $image[0] = 'http://...
0
votes
0answers
15 views

How to remove buttons from gutenberg toolbar

How do i remove some of the buttons in from a block toolbar in the gutenberg editor? I thought there was a similar api to removing blocks for the paragraph block, something like but there is 0 ...
0
votes
0answers
7 views

Where to hook to force WP to create compressed copy of uploaded image even if its small

I want to write a filter function and need help figuring out where it would be best to hook in or if there is any possibility at all. My problem: I am utilizing the jpeg_quality hook along with ...
0
votes
0answers
16 views

Inserting another image to footer.php

I would like to add another image/logo into my footer. However, there is no footer widget. There is only the footer.php with the codes but i do not know where to insert the image/logo or the what code ...
0
votes
0answers
21 views

Update Images after edit via php

After editing images directly inside the upload folder via PHP-functions, I managed to automatically regenerate the meta data, the thumbnails and the WebP copies. (Checked via FTP! Even the displayed ...
0
votes
0answers
17 views

How to add missing dimensions to all images to avoid cls?

My sites have lots of external images without dimensions, and that's causing layout shift. I need a code which automatically add missing width and height to all images. I tried 1 plugin Specify ...
0
votes
0answers
9 views

Trying to change the URL of a product image once I upload it, but there seems to be no way to access the URL

I've uploaded an image to my Wordpress site. I want to use it to set a product image. But, once I drag it into the Media Library the image does not show correctly - rather it looks like a place-holder....
0
votes
2answers
26 views

When the new post which has no image published, save the specific image as the featured image ( by category )

As the title, I would like to save the post with the specific image as the featured image, when it is new published. Also I would like to save different images which is filtered by categories. I have ...
0
votes
1answer
34 views

Hover a css icon width other color inside wp_get_attachment_image

I'm using ACF and have inside a loop: <?php echo wp_get_attachment_image( $button_image, 'small', 'sidebar-btn-icon', ["class" => "sidebar-btn-icon" , "alt"=> &...
0
votes
0answers
9 views

Default product image by user role

I would like to replace the default product gallery and the default product thumbnail if user have VIP user role. The vip thumbnail and gallery images are in 2 ACF fields: vip_thumb vip_gallery Now ...
0
votes
0answers
17 views

display image name in wordpress media library (grid mode)?

I would like the name of the images to appear in the grid view of the wordpress media page. is this possible from functions.php, to show the name of the image in the media page (grid mode)? many ...
0
votes
0answers
15 views

Attachment Page Permalink/URL Problem

I'm facing an issue with the attachment URLS. I want to redirect all my media URLS to my product pages but for some reason there are two kinds of URLS being generated for images. for example: example....
0
votes
1answer
27 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 exclude images from scrset based on file size (kb)

when I upload optimized jpg images to Wordpress, I encounter the following problem: The original image file size is smaller than the auto-generated images (for the 1st and sometimes even the 2nd "...
0
votes
0answers
8 views

Serve scaled image for homepage logo

All my other images are fine for scaling and thumbnails except the company logo jpeg that is on my homepage. How do I make it "serve as as a scaled image"?
0
votes
0answers
14 views

Select Image from Media Library and insert into page with responsive markup

I'm building a site for my friend which uses a custom theme and no page builder. The home page has 4 splash images, and to make things as simple as possible for him I'm trying to create some ...
0
votes
1answer
31 views

Shortcode not work in picture source srcset tag

I have in my WP plugin: <picture> <source srcset="[bloginfo key='template_url']/images/image.webp" type="image/webp"> <img src="[bloginfo key='...
1
vote
0answers
20 views

image url relative path not working in css file

When i write this in css file image will loaded background-image: url(http://localhost/wordpress/w3/wp-content/themes/test_theme/images/img.png) if i write this in css file image will not-loaded ...
0
votes
0answers
15 views

How to access theme template variables from page's code editor?

I created a new php template for my page, and choose it with Page attributes- Template. This php template has an $imageData variable which I want to load into my page with the code editor (instead of ...
0
votes
1answer
18 views

Bulk Upload Image Alt Text

I have a Google Sheet/Excel doc with unique Image Alt text for all of the images on my site. I'm looking for a way to bulk upload those, either using a plug-in, or through phpmyadmin. Any help or ...
1
vote
0answers
21 views

Prevent Image Pasting in RichText Component

We have several blocks that are using the RichText component. We would like to be able to prevent some if not all of these blocks from allowing pasted images. Core is able to do this with their blocks....
0
votes
0answers
17 views

Editing already up-loaded images

I am fairly new at using wordpress and have been working on a blog for quite a while.. These past few days I have been uploading pictures - which I have finally managed to do however, I find that the ...
0
votes
0answers
24 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
12 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
1
vote
2answers
23 views

Get different images for mobile and desktop with php, advanced custom fields without using js and ajax

I hope everyone is well! I am looking for a possibility to load different galleries, background images etc for the phone and desktop. For example, I set my hero background image like this: <...
0
votes
0answers
13 views

Image path in Wordpress Multisite setup

I have a WordPress multisite setup like this: main.com (main domain) second.com third.com ... When I upload any image to second.com (or any other instance) using media library all image paths have ...
0
votes
0answers
8 views

img sizes show only one value

Setting up a new theme, I realize WordPress is outputting only one value in sizes. for example: <img src="https://site.dev/img-1-324x324.jpg" loading="lazy" srcset="https:/...
1
vote
0answers
8 views

How to fix “.webp” being auto-added to the end of image urls

Idk what's causing this. Only thing I can think of is I migrated briefly to Cloudflare and came back. It's adding extra code to the end of the image url and breaks the path. Anyone seen this? https://...
0
votes
0answers
17 views

Add width and height attribute to an img tag

I am using Hood Theme and I have a logo on the top left on my navigation. I have set this logo to 150x50 which works fine. But the tag doesn't have the width and height attribute. Google PageSpeed ...
1
vote
0answers
14 views

How to create 'Local' filters for WordPress srcset sizes in template parts?

I've read a bunch of tutorials on how to create filters for srcsets and srcset sizes, but they all appear to be applied globally, with a fixed width or set of widths for sizes. The trouble is, I pull ...
0
votes
2answers
23 views

Hide Title tag on image Hover

I would like to hide the image title tag when hovering an image as they aren't needed on my website. I have tried this code below and added it above the closing </head> in header.php but it ...
0
votes
0answers
9 views

show category list with images of associated posts

any way to display a list of categories with a single image of any post associated with that category? i have this code: $categories = get_categories( array( 'orderby' => 'name', ...
0
votes
0answers
7 views

Store wordpress images by size folders, can't get the slug by size

I used the post explained here, I can not comment there as I don't have enough reputation, so I created a new topic. When using this code, i am well generating the thumbnails in subdirectories by ...
0
votes
0answers
20 views

Exclude image title from site search results

A user pointed this out to me recently and I've been scratching my head trying to figure it out. Currently the standard wordpress search box on my site is returning images in my media library in the ...
0
votes
1answer
26 views

Why Wordpress suddenly changed sizes of thumbnails?

I'm consistently using 3000x750 images for the standout images for my entries. I've recently added a new post with such image (I'm 100% sure about its size) and I've realized, that for some reason it ...
0
votes
0answers
12 views

Images are getting corrupted on upload after server backup

I'm using Amazon Lightsail, I restored my website to yesterday's snapshot. Now each time I upload JPEG/JPG image they got corrupted (doesn't happen with PNG). I tried to create a new instance from the ...
0
votes
0answers
16 views

Automatically add Link Images to Posts in WordPress if has not linked before or has specified class

I use this code to Automatically add Link Images to Posts in WordPress. function wpguy_linked_image($content){ if (is_single() === TRUE){ $searchfor = '/(<img[^>]*\/>)/'; ...
0
votes
0answers
10 views

Uploading Pictures Simultaneously

Batch images can be uploaded to the "Media" folder in Wordpress. I'm having a problem here. Wordpress uploads all the images I choose one by one. I want all images to be uploaded at the same ...
0
votes
0answers
8 views

Can't scroll website over product image on mobile version

I was testing my site on my mobile phone and I noticed I can't scroll when passing over a product image on the product description page. Here's the same issue on this example: http://demo2.themelexus....
0
votes
0answers
21 views

Please how do I make my wordpress post images show, It's showing data:image

Please how do I make my wordpress post images show, it's showing data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 making my images not to show up on my post content, but ...
1
vote
0answers
14 views

Add custom image size for custom post type or taxonomy

I am trying to create specific image sizes for specific post types, taxonomies, or pages. I have done it for post types and pages but I haven't for the taxonomies. Do you have any ideas about how to ...
0
votes
0answers
11 views

Post Images URL in Bootstrap Carousel

So i made a blog with some posts, that contain a few images that i want to show in a carousel using Bootstrap. Right now, my code gets all the images and their URL's and i want to use those URL's in ...
0
votes
1answer
31 views

Get URL from all images in a post

so i made a blog and a few posts, but i would like to get all the URLs from the images in a post, and then later put them in a carousel. But right now it doesnt find any images and says No images ...
0
votes
1answer
18 views

How would you add sequentially numbered labels to images in posts?

I'd like to add sequentially numbered labels to images in posts. Just a small number in the corner of each image to help when referencing them in my writing. All of the images are wp-block-image (no ...
0
votes
1answer
22 views

Where are the src and srcset sizes coming from?

I want to find out where the src and srcset sizes are coming from.

1
2 3 4 5
69