As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [media]

An image, audio or a video comprises a media.

Filter by
Sorted by
Tagged with
1 vote
0 answers
25 views

Media Gallery Upload photo incorrect way like glitch

I start having this issue like 3 days ago, I disable all plugins but nothing works. See the examples: Original photo: after I upload:
z00x's user avatar
  • 11
1 vote
1 answer
2k views

Create a new post using rest api and save featured image using an external image url

I am trying to create a post using the rest API. Which I am able to do with a fetch request as below. OurPostData contains the title, content and URL of a featured image which is an external url ...
user avatar
0 votes
1 answer
149 views

Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?

I am working on a plugin that gets image URLs from an API, some being PNG, JPG, and others JPG without an extension. I've been trying to use a combination of download_url() and media_handle_sideload() ...
whatifthis's user avatar
0 votes
1 answer
18 views

Attaching a file to a page without adding to media library?

We are using WP for our new intranet, which will primarily be used for documentation and archiving. We have some pages where we want to attach PDFs, documents, images, etc. However, we do not want ...
Ray's user avatar
  • 1
0 votes
1 answer
42 views

Thumbnail images chopped off but not cropped to exact dimensions

In Media Settings I have Thumbnail sizes set to width and height of 150 and "Crop thumbnail to exact dimensions (normally thumbnails are proportional)" is not checked. Since the checkbox is ...
Anthony's user avatar
  • 31
1 vote
0 answers
26 views

Restrict media upload size by format

I'm looking for a way to restrict the size of the media when uploading (a plugin or just a function). So I found this: function increase_upload_size_limit( $limit ) { return 524288; } add_filter( '...
Elsa's user avatar
  • 11
0 votes
1 answer
41 views

Upload media only to DB

I'm using the latest WordPress (5.6) and from what I've found out there's no visible setting for uploading media directly to a DB. Is there such an option somewhere hidden or does WordPress not ...
Peter Badida's user avatar
0 votes
1 answer
122 views

where can i add custom script to stop header video from autoplay

How can I add the custom script from this answer to my site to stop the custom video header from autoplaying? $( document ).ready( function() { $( document ).on( 'wp-custom-header-video-loaded', ...
hossam alaaeldin elsayed's user avatar
1 vote
0 answers
127 views

media_handle_upload() progress bar

I'm using the media_handle_upload() function to upload several type of file in the media section of Wordpress Backend. Is there an easy way to have a progress bar linked to this function to give some ...
Pickeroll's user avatar
  • 111
1 vote
0 answers
24 views

WordPress: cleaning media library

I'm giving my website a clearout whilst I redesign it, and thought I'd delete a bunch of old images from the media library (about 50 or so). I thought this would free up a lot of space, but now I see ...
user avatar
0 votes
2 answers
107 views

Flat media folder vs multiple directories

I recently took over a website that uses a flat media folder in the site root. Is there a benefit to that over using the standard WordPress media folder structure of uploads/year/month/file? We have ...
juusui's user avatar
  • 1
1 vote
0 answers
31 views

How can I get the media inside a post?

I’m new to WordPress, so please forgive me if my question is not clear or vague. I did a lot of research, but I didn’t figure out how to do the trick. I’m developing a Xamarin application for Android ...
Pine Code's user avatar
  • 111
0 votes
0 answers
72 views

WXR file - Media import failed - how to force import?

Say I have one Wordpress A that I want to move to Wordpress B (different IP addresses, different servers, different subnets). Server A is behind a private IP address. When selecting export function on ...
Ken Addams's user avatar
1 vote
1 answer
510 views

add mediaelement.js plugins into WordPress video player control bar

im trying to add SkipBack and JumpForward Plugin of mediaelement.js into my wordpress [video] tag controlbar. so far i have added those to plugin js in a js file (videoplayerjs) like this : /*! * ...
ErfanMHD's user avatar
0 votes
1 answer
189 views

Is there a way in WordPress to convert images to WebP without a plugin?

I'm building a simple WordPress theme for personal use. Speed is important. My Google PageSpeed Score is high, but it keeps saying that I should use WebP, rather than JPG. ('modern web formats'). As I'...
ralphjsmit's user avatar
0 votes
0 answers
13 views

Put images in the media from url functions

When the client installs my theme I would like to automatically download images and add them to the media library, e.g. from links like this: https://images.pexels.com/photos/2228559/pexels-photo-...
AlexSol's user avatar
1 vote
0 answers
21 views

Multisite - Images often getting uploaded to the wrong month directory

Previously I had only a single site enabled but recently enabled a multisite option. Now the issue is that the images are getting uploaded in the wrong month directory. It should be uploading to 11 ...
Kevin S's user avatar
  • 37
2 votes
0 answers
562 views

How to change upload directory based on frontend form input name or ID?

I created a frontend form using a plugin which allows logged in users to create draft posts. There are 3 file upload areas. I need 1 of them to use the default public WP media upload folder as usual. ...
user197754's user avatar
0 votes
1 answer
565 views

Can't upload format files on media library

I have an issue for uploading .ppsx format on the media library. all the powerpoint format (pptx ppt, pps) can be uploading without problem except the .ppsx format and i don't know why. when i try to ...
Samuel's user avatar
  • 314
0 votes
1 answer
241 views

Upload error on localhost (at minimum, not yet tested online)

uploading a picture on localhost I keep receiving following error: Post-processing of the image failed likely because the server is busy or does not have enough resources. stopping any upload, even ...
lyllo's user avatar
  • 1
0 votes
2 answers
9k views

Wordpress media upload issue could not insert attachment into the database

Could not insert attachment into the database. When ever I try to upload new images from WordPress media it shows me above error. Please help me why wp database shows this error.
Aman Kamboj's user avatar
0 votes
1 answer
239 views

How to add HTML into error message

php I have a filter for limit max upload file size with custtom message. I want to add link there, but html does not work here. Can you help me someone? Here is my code add_filter("...
Silmarion's user avatar
0 votes
1 answer
97 views

Built-in image lazy loading: Does it come with a polyfill for older browsers?

It's neat that WordPress now automatically adds the loading="lazy" attribute to images. My question is: Does WP now also have a built-in JS polyfill for browsers that don't support the ...
William Beaumont's user avatar
0 votes
1 answer
560 views

Move media files from the root to date folder structure

How to move existing media files fro the root of the uploads folder to subfolders or date structured folders?
Ahmad Darwish's user avatar
1 vote
0 answers
81 views

How to extend WP_Widget_Media

I am new to WordPress theme development. I'd like to create a new widget based on the built-in Image widget, with additional fields such as 'description' & 'speaker'... etc. The widget is called '...
brian's user avatar
  • 111
0 votes
0 answers
269 views

Getting image data from phone camera (MediaDevices.getUserMedia) into user post

Sorry for the newbie, and poorly arranged question... I'm trying to develop a super simple user based wordpress site. I want logged in users to take a photo with their phone which is then uploaded as ...
Louis Ryko's user avatar
0 votes
0 answers
28 views

How to change Route respond To A specific Path?

To increase site loading time and decrease the pressure on my website I have decided to host files(js,css,images) in other hosting, like google storage or amazon aws, problem is that I already ...
ali filali 's user avatar
1 vote
0 answers
62 views

WordPress automatically downscaled images larger that original

I have a real head head-scratcher. I am trying to boost the performance of my wife's website. One of the things I identified as potential issue was the size of image files. I am somewhat aware photo ...
Raff89's user avatar
  • 111
0 votes
1 answer
38 views

Automatically Insert alt attribute above image has h2

When inserting an image in a WordPress post, I would like that it automatically add the alt text of the image above the image as h2. Example, when inserting an image, WordPress ads this into the post: ...
Josh's user avatar
  • 11
0 votes
2 answers
1k views

SVG not displaying in Media Tab in Backend

I addes this code to allow SVG Uploads to the Media Library of wordpress: function upload_svg ( $svg_mime ){ $svg_mime['svg'] = 'image/svg+xml'; return $svg_mime; } add_filter( 'upload_mimes', '...
Niqql's user avatar
  • 53
0 votes
1 answer
213 views

Media Library modal customization

I have a fashion website and I use a large amount of images on my website, As I add new products I should add product images and for that I use media library modal but the problem is working with ...
ahmad shahoseini's user avatar
0 votes
1 answer
1k views

Get all uploaded images using REST api

I need to get all the images that are uploaded in my wordpress installation using the REST API. I've tried using the wp-json/wp/v2/media endpoint but it will give me only the last 10 images uploaded ...
jimmy26's user avatar
2 votes
0 answers
219 views

How to search media library alt text and title fields

I need to be able to search in the WordPress media library alt text and title fields. I've previously used a plugin called Media search Enhanced by 1fixdotio (https://wordpress.org/plugins/media-...
Andrew Abbott's user avatar
1 vote
0 answers
26 views

How to open default wp image editor screen dynamically?

I'm displaying gallery images of the logged-in users on the frontend with the edit button. Now I want to link that edit button with the default WP Image Editor screen that includes tools like crop, ...
Rameez Iqbal's user avatar
0 votes
0 answers
114 views

Wordpress media has all disappeared on wp-admin but still on the server

I realise this is a very common problem and I have done all the basic debugging - deactivating plugins, changing to 2020, permalinks and various fixes have been suggested. None have worked so far. ...
David Arnold's user avatar
0 votes
1 answer
35 views

Which post/page an image is attached to

When I filter by unattached in the Media Library, it returns images that are used in posts and pages. Are there ways to see which specific posts/pages an image is attached to?
CuppaCoffee's user avatar
0 votes
0 answers
16 views

IPTC and custom thumb size

I've created some additional custom thumb sizes for images. Original image has EXIF and IPTC datas which are important for me. But images generated for new thumbs has not these datas. They are ...
D_P's user avatar
  • 141
1 vote
0 answers
32 views

Finding a media attachment post ID from a URL

Given I have an image URL And that the image has previously been saved in the media library How can I find the media's ID? i.e. https://somesite.com/uploads/pic1.jpg might be ID 4 ...
John Dee's user avatar
  • 493
1 vote
0 answers
1k views

Add PDF to ACF image field from file url

I am basically looping some fields from a gravity form entries. I using this function below to pass a file url into $filename and convert the file into a media library item, and then attaching that ...
joshmoto's user avatar
  • 447
0 votes
1 answer
30 views

media file uploading

i am using this query in my plugin to uploading media file , when i keep it file in wp_enqueue_script it working properly except after i select the image , this code does not return on wordpress page. ...
Arshpreet Venveru's user avatar
0 votes
0 answers
52 views

Modify Maximum upload file size text in Wordpress Media

I'm working with my own plugin development for my website. I need to modify the text of the Maximum Upload file size (post-upload-UI). I tried with the below hooks. wp_handle_upload_prefilter, post-...
tacker's user avatar
  • 3
0 votes
0 answers
421 views

Code snippet to add filter pre_post_link to change Media URL (post_type attachment permalink/slug)

I found a very good code snippet to add a "base" into URL of blog posts: Custom permalink structure with a prefix just for posts I tested it and it works great for post_type: post (to test ...
Ben Hoven's user avatar
0 votes
1 answer
56 views

Can't locate custom image sizes defined by child theme

I'm developing a child theme (mms-child) based on a simple parent (mms – also my dev). I am quite used to the usual way of defining custom image sizes within functions.php as follows: ...
mtm's user avatar
  • 39
2 votes
0 answers
121 views

How to host different file formats/types for a media attachment without creating multiple attachments?

For a better browser compatibility we often have to maintain multiple format of a media. For example: Image - JPG & WebP Image animated - GIF & WebP Image transparent - PNG & WebP Video - ...
Sisir's user avatar
  • 7,735
1 vote
0 answers
41 views

Updating Media Published Date When Parent Post Is Modified in Wordpress

I am hoping to make the published date of my media files always equal the modified date of the post it's attached to. e.g. Image 1 (date: 1/1/20 5:00PM) is attached to Post 1 (date: 1/1/20 5:00PM) ...
JimmyNeutron666's user avatar
0 votes
2 answers
538 views

Missing a temporary folder not fixed

I uploaded my first wordpress website on the server, but trying to add new media files, i have got the message "Missing a temporary folder", I tried the solutions on the forum: define('...
Hind Dev's user avatar
  • 103
0 votes
0 answers
354 views

WordPress REST API to get all media not working

I am attempting to get all the media from my site www.napkinsights.com. However, when I call https://napkinsights.com/wp-json/wp/v2/media, I am given an empty array []. How would I be able to get all ...
Sveltestorb70's user avatar
0 votes
1 answer
443 views

Building a Featured Gallery component for Gutenberg

I'm building a Featured Gallery component for Gutenberg. As a guide, I'm using the existing Featured Image component from Gutenberg. Basically, instead of storing a single image id, the component ...
leemon's user avatar
  • 1,708
0 votes
1 answer
1k views

Images not loading on webpage, and links to other media give 404 Not Found

Had some recent problems where to start with only homepage text was visible, all other pages/links gave 404 Not Found. Now managed to get pages to function but all images fail to load, plus links to ...
Jamie's user avatar
  • 1
0 votes
0 answers
86 views

How to remove media by filename?

For some reasons, when I´m doing an import of data to make posts and medias, I can have : Some media not attached but with an image Some files still saved in uploads folder but not visible in Library ...
J.BizMai's user avatar
  • 810

1 2
3
4 5
22