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

wp_get_attachment_image - enable width and height attributes for an SVG image

When I use wp_get_attachment_image(), I expect output like this: <img width="150" height="150" src="http://example.com/wp-content/uploads/2017/11/image-xyz-150x150.jpg"...
0
votes
0answers
18 views

How to only show div of caption if caption exists on featured image

I am trying to only show image captions on featured images. However, if the image does not have a caption, I do not want it to show the <figcaption> tag. I have added the following code to my ...
0
votes
0answers
13 views

Show div <figcaption> if it exists other wise no <figcaption> should be displayed in HTML

I am learning PHP and I am trying to add on featured images. However, if the has not be specified on an image, I don't want to display in the HTML. Currently the code always outputs in HTML ...
0
votes
0answers
12 views

Prepend to all image URLs with PHP, only for mobile devices

Is there a way, with PHP, to prepend my CDN service's URL to all of my images only when using a mobile device? The reason I ask to do it with PHP is because my site is AMP compatible, which doesn't ...
0
votes
1answer
10 views

Conditional Generation of Image Sizes using add_image_size

The add_image_size function is used to add image sizes in addition to the default thumbnail, medium, large, & full which are generated in WordPress by default. Is there any way to only add those ...
0
votes
0answers
18 views

Delete media from the post but keep my featured image and post

I have a lot of posts on my news site, I have a problem with space, I would like for posts older than three months, to delete the images that are in the post, but to keep the featured images and the ...
0
votes
1answer
19 views

How to remove image size inline style in article and include caption

I am using the following filter to remove the inline style in the image tag when used in the content editor of the ACF text field: add_filter( 'post_thumbnail_html', 'remove_width_attribute', 10 ); ...
1
vote
0answers
33 views

Images will not display, when I call them up with html in wordpress, just two blank small spaces [closed]

I am trying to get images to display, when I call it up with html in wordpress. I am using html instead of the image block in wordpress, as I want to animate the images a bit. I also uploaded the ...
1
vote
1answer
40 views

wp_get_attachment_image function size argument not working if I also add a custom class

I'm trying to output some images the right way, using the wp_get_attachment_image function. Here's how I do it: echo wp_get_attachment_image( $image_id, 'image-size', '', [ 'class' => 'some-class' )...
0
votes
0answers
8 views

Allow wp media library to check already selected images displayed in div

I would like to replicate the media selector library in my plugin: (I have a button, I click on this, the media library display, I select images and add in a div below) When I select one image or ...
0
votes
0answers
72 views

How to "lazy load" post thumbnail

<?php the_post_thumbnail( 'medium-thumbnail', array( 'loading' => false ), [ 'alt' => esc_html ( get_the_title() ) ] ); ?> Get Diagnostics info on pagespeed Largest Contentful Paint ...
0
votes
0answers
15 views

How can we upload common images only to AWS S3 using WordPress?

There are multiple plugins for uploading images to AWS S3 and Cloudfront from WordPress but none has the features to restrict by post type. I want to upload only common images which are to be shared ...
0
votes
2answers
29 views

Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial

I am following the official WordPress "Create a Block Tutorial" located here: https://developer.wordpress.org/block-editor/handbook/tutorials/create-block/ I used this as a starting point ...
0
votes
0answers
17 views

How to assign a custom field value (URL) to featured image for woocommerce products [closed]

I'm using wordpress automatic plugin to import envato products to Wordpress. But, the preview image on themeforest is not assigning as the featured image. I'm trying to import them as woocommerce ...
0
votes
0answers
18 views

Retrieve alt text by referencing the img src

I have a website with 400+ images. Using a spreadsheet plugin I've been through and manually added alt text to each of the images. The problem I have is that the pages are built with a page builder ...
0
votes
0answers
22 views

Is classical wordpress eidtor a good option for me to include a large table with a large number of images on my webpage?

I am a beginner at using WordPress for my website. I generally design my website using the classical editor provided by WordPress and by installing very few plugins such as Beaver Builder and code ...
0
votes
0answers
8 views

How to join Caption AND Description Meta Fields as one combined-caption in Image Block

Use case: Inserting Image Block (inapplicable for others, like Gallery Block). I'd like to use caption (post_excerpt) as real description of an image (what it shows), and also append additional info, ...
1
vote
1answer
68 views

Disable auto-resizing of uploaded images, but only for certain filename

How can I totally disable the wordpress auto-resizing when uploading images, but only for images that have a certain string in its filename. Eg. disable auto-resizing on images in which its filenames ...
0
votes
1answer
19 views

Deleted Image giving a 301

I have images that were deleted from the site (the page and the media library) but are still being requested which can be seen in the network tab. They are redirected and take a huge amount of time ...
0
votes
0answers
22 views

Avatar picture is broken

I've loaded and reloaded my picture into Gravatar, but it still displays as broken in my admin panel. Also, the email address for my Gravatar account is the same as the email address in my admin ...
0
votes
0answers
15 views

Show next image in array if page is revisited by same logged user

I have a wordpress website, I want users when visiting a particular page to see an image, but if they go to another page and visit the previous page again, the image should have changed. The image ...
0
votes
0answers
22 views

Wordpress append -1 to the image name

For e.g. I deleted apple.jpg. Image is deleted permanently. After a while, I upload apple.jpg. Wordpress still append -1 to the image name apple-1.jpg. However, apple.jpg is no where to be found. I ...
-1
votes
1answer
57 views

Blurry Images Wordpress 5.8.1

I've tried to Use .png instead of .jpg Disable wordpress default compression add_filter('jpeg_quality', function($arg){return 100;}); Switch themes to test Disable plugins Regenerate thumbnails ...
1
vote
0answers
27 views

How to wrap normal image tag with figure HTML5 element

This is what i am trying to achieve: -- Code i am trying in wordpress:- function html5_insert_image($html, $id, $caption, $title, $align, $url) { $html5 = get_image_tag( $id, $alt,$url, '', $...
0
votes
0answers
26 views

Using srcsets in a custom block

I'm building a few custom blocks and have come across something I am not sure is either possible at the current time (as there does not seem to be docs on it), or it is something people are still ...
0
votes
0answers
24 views

Enlarge an image slider when click

I'm new to WordPress and I don't know if there is a plugin that allows to create a responsive slider and enlarge it to full screen when clicked on. A way to do it with code is also fine. Thanks!
0
votes
0answers
16 views

Is there a layout to place 2 same sized images in two columns on the WordPress page?

I need to place two images on a landing page of a WordPress site as below. I don't find a suitable layout option under Flexible Content field group that fits my requirement. I believe I should be able ...
3
votes
0answers
39 views

@wordpress/create-block image url in css

how to include image URL to css "style.css" in custom block? Both these not work: background-image: url("images/imagename.png"); background-image: url("./images/imagename.png&...
0
votes
0answers
13 views

How to change an image source when rendering on frontend?

when showing articles, let's say there are images with watermark. But of course, those images are somewhere else, the watermark itself is not rendered onto the source image. So, just before rendering, ...
0
votes
1answer
38 views

WordPress Favicon not Working For Images/Videos/PDFs

I am using WordPress with Neve theme, for my site, Favicon is working on posts/pages, but Favicons aren't visible for JPG/PNG/Videos. If I use the Theme Customizer and select the Favicon PNG image, it ...
0
votes
0answers
11 views

How to restrict media upload resize by filename suffix?

I'm trying to resize image dimensions when I uploaded images to the Media Library so I don't have extraneous sizes I don't need clogging up the uploads folder. I'm defining specific sizes with ...
0
votes
0answers
19 views

images destroyed after using wp_get_image_editor

this is a really weird problem. i use wp_get_image_editor to resize my original featured images and save it and display on my website. after uploading and using it as featured image, most of time the ...
1
vote
1answer
15 views

In Wordress one author can not see the other's author uploaded images through media library

My problem is simple to explain, when author 'A' uploads an image, author 'B' can not see them in the media library and via verca. Any idea what could cause this problem? As an administrator i can see ...
0
votes
0answers
21 views

Adding Custom Image Upload button to uploaded image and Automatically inserted into post?

I successfully added custom image button at my classic editor with this code add_action('media_buttons', 'add_image_button'); function add_image_button() { echo '<a href="#" id="...
0
votes
0answers
7 views

Imported image does not load or are stretched

I have a website in AWS Lightsail, it has a domain and ssl protocol, so url starts with https://. I exported, made a backup, I did a new Lightsail app, imported xml, but some of the image does not ...
1
vote
0answers
85 views

How to control WordPress image metadata (using Imagick)?

In short, I'm having trouble with the WordPress Media Library image editor and how it handles metadata. I use the Imagick PHP extension (but also tested with GD for comparison), and in all ...
0
votes
2answers
33 views

Console Browser says it cannot find a requested image that does not exist on my Website [closed]

I have a site that I am working on and I noticed that I get this error in my browser console: Failed to load resource: the server responded with a status of 404 () It was trying to load a image file ...
0
votes
0answers
13 views

Modify every image url permalink what is Wordpress serve from my site

0 I use Cloudflare and I would like to add https://cloudflaresitename/cdn-cgi/image/width=800,quality=95,format=auto/ prefix to every image what is my Wordpress page is seved. I want to look my images ...
0
votes
1answer
16 views

Images under 1MB are not being compressed

Images that are above 1MB get automatically compressed on upload. Images that are smaller than 1MB are added to the database in their raw form. So, if someone uploaded a 900 KB image, the post will ...
0
votes
0answers
13 views

How to modify an image Gallery block in WordPress?

simply i want to remove <figcaption> from every image and remove text between <figcaption> tag' <figcaption class="blocks-gallery-item__caption">Image caption</...
0
votes
0answers
17 views

Processing resized images upon upload

WordPress creates resized copies of images that are uploaded to the media library. When I upload an image, I want to do some processing on these resized images. Currently, I'm using a add_attachment ...
0
votes
0answers
14 views

Limiting the number of images resized during upload

I'm troubleshooting issues with image uploading and noticed that each imaged uploaded is making literally 10 sizes of varying proportion. I don't understand why. Why are there so many resized versions ...
0
votes
0answers
24 views

Large uploaded images not resizing?

I'm uploading images of varying size, and am noticing that larger images are not resizing/scaling to smaller versions. The only one that was resized (below) is only about 9MB, and has (quite a few) ...
0
votes
1answer
27 views

Fullscreen Page Background without Plugin [closed]

I am using the Advanced Layout builder for editing pages in the Enfold theme. I've seen many solutions via code editing or plugin additions, but I am behind a controlled environment and do not have ...
0
votes
2answers
18 views

Get all image in media Gallery with alt/title?

Is there a way to fetch the ALT/TITLE of ALL images in the media gallery? I think this would be an easy way for a website to have a Pictures page that just pulls all of the images from the media ...
0
votes
0answers
17 views

Images going blank after a while

After inserting my images as a PNG, they displayed as expected but after a while they go blank i noticed " pagespeed.ic.N2uHZILiyd.webp " added to my images right after .png ex : https:...
0
votes
0answers
17 views

How To Show Download Button In Gallery Images

I want to put a download button below every image in my post. see demo- http://m.gettywallpapers.com/twice-sana-wallpapers/ I want put href link every image
0
votes
1answer
24 views

Confused about image sizes generated by Wordpress

I have read in other threads in this forum that Wordpress creates three copies of any image you upload each of different dimensions; but on my website it seems to be creating well over 10 copies of ...
0
votes
1answer
23 views

Allow users to upload and display multiple photos

So basically I have a social website and I want for Wordpress users to be able to upload pictures and display them on their front end profile page. I have been looking into the user submitted ...
0
votes
0answers
17 views

Blurry images when using add_image_size with crop

I've got the following image size: add_image_size( 'medium-thumb', 350, 350, true ); The images generated using the code snippet above are heavily compressed and turn blurry. This is the original ...

1
2 3 4 5
70