New answers tagged

-1

The default image sizes of WordPress are “thumbnail”, “medium”, “large” and “full” (the size of the image you uploaded). These image sizes can be configured in the WordPress Administration Media panel under Settings > Media. This is how you can use these default sizes with the_post_thumbnail(): the_post_thumbnail(); // without parameter ...


0

From a quick look there is a dedicated delete_attachment action in wp_delete_attachment() function, it gets passed an ID of attachment being deleted. However I am not completely confident that this covers all cases. There is a fair amount of duplication in WP's post–related APIs and similar tasks might be performed by different functions in different ...


2

Thanks to @Tim Malone, @Kane Uploads are handled in the wp-admin directory, so try placing it in there. I've had success with placing php.ini files in there on shared hosts. – Tim Malone 1 hour ago Just place .user.ini to /wp-admin to overwrite the setting.


1

Your first function get_images_from_media_library() only returns images guid, I'd suggest to extend it by returning all image datas : function get_images_from_media_library() { $args = array( 'post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => 6, ...


1

is there a way to update all media urls in wordpress I had a similar issue with my media files not having the correct file location after a Wordpress upgrade (somehow all the media links switched to a crazy incorrect directory), so I found Upload URL and Path Enabler which was able to rewrite all media URLs to a different path location where all my ...


0

If you need to track single file, and you have the URL of the file, and you have the access.log file set up right, then you can just use grep Linux command. grep "/downloads/my-file-name.media" /var/log/access.log To get the number of requests grep -c "/downloads/my-file-name.media" /var/log/access.log or grep "/downloads/my-file-name.media" ...


1

You need to create attachment.php in your child theme. Please check here for more details.


0

Also happened to me, because of mod_expires.c The rules were causing the 404, but the files were OK on FTP: ## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/gif "access 1 week" ExpiresByType image/jpg "access 1 week" ExpiresByType image/jpeg "access 1 week" ExpiresByType image/png "access 1 week" </IfModule> ...


3

I'm copying a previous answer here as I think it will help. What this will do is whenever the media library pops up, instead of showing all media for a given post it will filter down to only images attached to the post. You could paste this right into your functions file: /** * Media Module - Only Show Images Uploaded To this Post */ function ...



Top 50 recent answers are included