Hot answers tagged

2

You can get what you want via: function get_the_file_urls( ) { $query_media_urls = array( 'post_type' => 'attachment', 'post_status' => 'inherit', 'posts_per_page' => - 1, ); $query_urls = new WP_Query( $query_media_urls ); foreach ( $query_urls->posts as $url ) { ...


2

In general I wouldn't recommend modifying the original uploaded image files, just in case we might need to re-generate intermediate sizes. But let's see if it's possible :-) We can in general let WordPress choose the image editor, that depends on modules like GD or Imagick, through: $editor = wp_get_image_editor( $file ); but this can return an WP_Error ...


2

The add_attachment action is fired when the wp_insert_attachment() function is called to add an item to the media library. Images are added to posts after going into the media library first. Even when adding via the post editor, items are added to the library with wp_insert_attachment() then to the post. add_action( 'add_attachment', xyz_my_function() { ...


1

I think I may have the solution below :) Try adding this to your CSS file: @media screen and (max-width: 479px) { .sow-slider-base ul.sow-slider-images li.sow-slider-image.sow-slider-image-cover { background-image: url('http://www.thousandgirlsinitiative.org/wp-content/uploads/2016/04/Wendy-mobile.jpg') !important; } ...


1

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


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 ...



Only top voted, non community-wiki answers of a minimum length are eligible