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
0 answers
1 view

Inside post image title has been posting as a post title on my main post page

I create a page for every post I want to publish on my Wordpress site, and on my main newsletter page I post every single post by its title, mostly all my posts page has an images, but recently I ...
0 votes
0 answers
25 views

How to get dimension of Logo and Crest

I want know width and height from (images) Logo and Crest, current I use standard PHP function getimagesize in my theme /** * Get dimensions for image */ if (!function_exists('get_image_dimensions'...
  • 121
0 votes
1 answer
37 views

Can't upload svg files in WordPress

I am facing the following issue while uploading any SVG file and sometimes face the same issue while uploading any image. "The server cannot process the image. This can happen if the server is ...
0 votes
0 answers
13 views

Is is possible to append .webp to srcset images using wp_filter_content_tags()?

I am using wp_filter_content_tags() to serve my images so it will include the necessary srcset images and lazy loading attrs. My server env makes using a traditional webp conversion plugin a pain so I ...
  • 59
0 votes
0 answers
20 views

Random images from uploads folder and subfolder

I am trying to figure out the best way, to display random images from the uploads folder and subfolders. But i want only show images with a specific image description. Can anyone help me?
0 votes
0 answers
21 views

Wordpress Missing Images

I have an image on my site: https://cac.bensplayground.us/wp-content/uploads/2023/01/BTA-10006078_A.jpg But when I go to File Manager and look in the folder, it simply isn't there. HOW is that even ...
0 votes
0 answers
10 views

Crop custom image size vs actual size

I need to use specific image size with add_image_size to true using ACF image field and wp_get_attachment_image From this side, my image is displayed well and resizes well in 175*200. I would like to ...
  • 13
0 votes
1 answer
14 views

Could a very long article slow down all website and wpadmin?

There is this article in the wordpress website that counts: words: 8207 characters: 56302 estimated reading time: 43m 20 images and 183 paragraphs and 201 blocks. Could affect loading time of every ...
  • 161
0 votes
0 answers
6 views

Edit multiple posts featured image

Actually I imported posts from my another website, but I have only posts & their authors & their category & featured image is showing blank means not present. Now at every time I have to ...
0 votes
0 answers
25 views

Generate / attach Image srcsets from ACF Image Field

I currently have an ACF save post action that takes an image and assigns it to be the featured image. One problem I am having is displaying the srcsets. <img src="<?php echo esc_url( $...
0 votes
0 answers
50 views

Display first image's caption

I'd like to display the first image uploaded to a post plus its caption. The code below (functions.php + single.php) displays the image, but I have been able to figure out how to display the caption. ...
  • 1
0 votes
0 answers
15 views

Is there a way to upscale a media library original image to the nearest whole pixel in Wordpress?

I noticed today while manually regenerating thumbnails for images in the media library that at least one would not generate thumbnails for those sizes that had the same width as the image. In fact, ...
0 votes
0 answers
35 views

Download button under all images WordPress

I have a WordPress site with a huge number of images and I want to add the ability to download each one. they are contained in posts (one post contains 50-100 images). I tried using the "Files ...
0 votes
1 answer
38 views

How To Convert External Image URLs To Own Website's Uploaded Images Automatically?

I have a website with over 300 posts and initially I used to use external image URLs in my blogs instead of uploading it to my DB and using them. Is there any way to automatically get all the external ...
  • 1
0 votes
0 answers
16 views

Using Featured Image as Hero Background in Word Press

I have the Author Cats theme in Word Press (kimcoxauthor.com). I had hoped they would add this feature for the book pages in a future update since I bought a lifetime license for all updates but it's ...
  • 1
0 votes
2 answers
20 views

website images getting corrupt automatically

I have just migrated my website from hostinger to hostinger manually. And now when I upload any picture on my website the photos getting corrupted automatically. Although the picture was shown on my ...
0 votes
0 answers
66 views

Gutenberg block HTML image rendering override

Hello fellow developers, I am currently working on a side project using WP as my headless CMS which I consume via the REST API. When I retrieve the post's rendered content (post.content.rendered) my ...
0 votes
0 answers
115 views

WordPress 6.1.1 does not upload the .WEBP images but with old browser upload does it correct

I have WordPress version 6.1.1 and hello theme version 2.6.1 The issue is weird, from Dashboard -> Media I'm not able to upload .WEBP images. but when I click on Try the browser uploader instead it ...
0 votes
0 answers
8 views

Wordpress pointing animated GIF images with wrong file name upon upload (GIFs animation not working)

y’all! How are you doing?! I’ve been struggling with animated GIF images on my website for a while now, and I discovered the problem, but not the solution, still. When I upload an animated GIF as a ...
0 votes
1 answer
37 views

How to overwrite image if it already exists - Wordpress, Gravity form

How do I make the old file replaced when the user uploads a new one? Now the files are named a1.jpg, a2.jpg, a3.jpg. If the user uploads a.jpg, then I want to overwrite the a.jpg that already exists. ...
0 votes
0 answers
6 views

Attachment tag archive

I have found very useful code that creates attachment tag archive function ahub_query_attachments() { global $wp_query; { $wp_query->query_vars['post_type'] = array( 'attachment', 'page', '...
0 votes
0 answers
12 views

Images have dissapeared from media library and site

I manage a WordPress website for a client of mine. About a month ago she emailed me that some images are missing on the site. I have been investigating what could be the problem for a while now, and I ...
  • 1
0 votes
0 answers
34 views

Using medium_large image size

I have added a code snippet to utilize the "medium_large" thumbnail size. This works fine on the back end and I can select this image size in all image blocks. It also seems to output the ...
  • 1
0 votes
1 answer
86 views

Remove one srcset entry from wp_get_attachment_image

I'm using the following code to create a fullscreen background slideshow using the Swiper JS library: <?php function background_slideshow() { $args = array( 'post_type' => '...
  • 1,696
0 votes
0 answers
16 views

Blurry product card image - rendered is 486x452 vs 300x279 in real image. Smaller versions being autocreated and served using srcset

I'm a noob making my own website. It's pretty much ready but only now I noticed that my product card images are very perceptibly blurry. This happens even with all my CSS turned off. My theme is ...
0 votes
0 answers
24 views

How to return responsive images from a sanitize_callback?

I'm trying to sanitize the images of the customizer from my theme. I found an example on this topic and it works, but makes my template stop showing the image. With a var_dump(), I found out that the ...
0 votes
1 answer
53 views

set_post_thumbnail or media_sideload_image adds image multiple times in media library

I am trying to add the featured image to posts and that works, however, the featured image is apparently set everytime I check my post. <?php $post_id = get_queried_object_id(); $bla = "...
  • 299
0 votes
1 answer
52 views

Displaying all images from a WordPress post (including media library)

With this function, I'm getting only those images that I uploaded using the upload button in the post section. But, if I add an image from the media library in a post, it's not showing. I want to show ...
0 votes
0 answers
18 views

Custom Search on media files PDF images pages posts

Hi all – hoping to find a code solution for developing a custom search bar in WordPress that searches for both Posts/Pages but will ALSO search for media files such as PDFs and images. Basically I ...
0 votes
1 answer
37 views

image_get_intermediate_size always returns false

I have a question about the WordPress function image_get_intermediate_size. It seems to always return false for me. I've confirmed the image exists at different size - using get_attachment_image_src. ...
0 votes
0 answers
16 views

Change of displayed images for webp versions

I've got in my uploads folder in Wordpress all of images converted to webp - so now i've got in uploads 2 versions of each image: 1. jpg's/png's and 2. webp version. Images was converted to webp on ...
0 votes
0 answers
16 views

Profile Image displaying on Wrong side of Wordpress Navigation Menu

Am creating a WordPress site whereby am enabling users to upload their own custom profile images from a custom form. Once they upload am storing the image URL in a database table and the image is then ...
  • 1
0 votes
1 answer
64 views

Displaying an Uploaded Image as a Custom Avatar in Wordpress

Am creating a WordPress site whereby am enabling users to upload their own custom profile images from a custom form. Once they upload am storing the image URL in a database table and the image is then ...
  • 1
0 votes
0 answers
48 views

if user role is x - show image - wordpress

I have set up a member portal with ultimate member where users can fill in and submit various forms and then see the answers in a list. Each submitted answer is automatically converted into a pdf. ...
0 votes
0 answers
21 views

How to add height and width dimensions automatically to archive descriptions

I have this code which adds height and width data for images in posts and pages: function add_img_size($content){ $pattern = '/<img [^>]*?src="(https?:\/\/[^"]+?)"[^>]*?>/...
0 votes
0 answers
23 views

Add a custom image source

How would one hook into this image source list to add an additional option?
  • 101
-2 votes
2 answers
103 views

How to give path to image in wordpress?

If image location is themefolder/image/image.jpg then path will be src="<?php echo get_template_directory_uri(); ?>/image/image.jpg". But how do I give a path to an image in WordPress ...
  • 9
0 votes
1 answer
88 views

Custom Theme functions.php – Using add_settings_field and input type="file" to set custom logo

I've seen several examples for "add custom logo" to wordpress theme, most of which use this basic code, specifically function display_logo_element() { ?> <input type="...
0 votes
1 answer
31 views

WP_Image_Editor - How to save the new size of the image in the sizes metadata

For a custom post type I have an image upload/media library field, that adds images as attachments in the post. While saving the post I am resizing the selected image - to some new non existing images ...
  • 218
0 votes
1 answer
55 views

How to get Wordpress to resize images for srcset?

I've added a custom image size to my functions.php: add_image_size('banner', 1920, 300, true); I'm loading images in this custom size, using wp_get_attachment_image() to get a srcset. However ...
  • 3
-1 votes
1 answer
14 views

Titles with thumbnails in media library

I have about 3000 products and need to assign images to them. The images all have titles including the product name, but this does not display along with the thumbnail when I look at the media library,...
0 votes
0 answers
39 views

Upload to a specific media folder created by FileBird Lite

I have an import that runs in the background of my server through cron. I have a plugin called FileBird Lite (https://ninjateam.org/wordpress-media-library-folders/) that helps create folders and such ...
0 votes
0 answers
26 views

Add/alter image attribute before render

I have different images on each of my products pages, and I would like to programmatically, through PHP, add alt attributes to these images. The alt attribute value would be based on the title of the ...
  • 101
0 votes
0 answers
37 views

Thumbnail size keeps resetting automatically

Thumbnail size on my website is controlled by a setting in the theme. I set them - width 550 and height 339. When I publish a new post, the thumbnail size changes automatically. Now I set the same ...
  • 17
0 votes
0 answers
10 views

how to embed a crop feature for cropping images uploaded by the user

I'm creating a newspaper website and want my user to crop the already existing image and download cropped images from the website. please Suggest me a plugin or javascript code for this. It would be a ...
1 vote
2 answers
169 views

Wordpress can't get image url but both the attachment and the actual file are there

The following applies to all attchment images on my site: There is a PNG image attachment, its ID is 519271. wp_get_attachment_image(519271, 'thumbnail', false, array( 'id' => 'esjb-preview-image' )...
  • 155
0 votes
0 answers
49 views

My subdirectory sites images (except webP) are throwing to 404 page even they are exist

As I explained in the title, the images on my main site are fine, but the images on my sub-directory sites are not showing. Except for the WebP type, oddly enough. They are visible. İmages can upload ...
  • 1
0 votes
0 answers
11 views

I tried to move the featured image below the paragraphs but now it is displaying twice

I already have a featured image and I moved it to the below paragraphs but now the featured image is displaying twice. I don't know what I'm doing wrong here. add_filter( 'the_content', '...
  • 1
0 votes
1 answer
101 views

Uncaught Error: Call to undefined function file_is_valid_image()

This is the function doc. But when I ran the below I get Uncaught Error: Call to undefined function file_is_valid_image() $json_file = get_post_meta( $listing->ID, '_json_file', true ); $...
0 votes
0 answers
38 views

Understanding responsive imagery

I am not understanding responsive images in WordPress but wanted to share what I have tried/ understood so far. In my scenario I have an image that is around 4000px across, which is also around 4mb. ...

1
2 3 4 5
71