change video icons to selected thumbnail?

You can do this with a three easy steps: Create a directory in your theme that will hold all the new icons /themes/theme-name/images/icons/ Copy all the images from /wp-includes/images/crystal/ to your new directory Hook into the wp_mime_type_icon filter in your functions.php file Your filter would look like this: function change_mime_icon($icon, $mime = null, $post_id = … Read more

Clean up wp-content/upload/ folder

Every time you upload an image, WordPress automatically create duplicate copies of that image and re-size them to thumbnail and medium size. Most of the time, these images are not used. In addition, there could also be some images that you have uploaded, but did not use them in the post. These unused images could … Read more

Media Library not showing images properly

Got home now and I had a proper look at your included image. The problem that you are experiencing is related to the naming of your images. Images, like any other files should not contain special characters as these special characters are not treated the same by operating system/file managers etc Currently, from your image, … Read more

Media gallery: remove “insert into post” button keeping “Insert gallery” button

I solved in this way add_filter( ‘media_view_strings’, ‘my_media_view_strings’); function my_media_view_strings($strings) { if (!current_user_can(‘edit_theme_options’) ){ $strings[“insertMediaTitle”] = “”; //Don’t unset! unset($strings[“insertFromUrlTitle”]); } return $strings; } //Media button click open “Create Gallery” add_action( ‘wp_enqueue_media’, ‘openGallery’ ); function openGallery(){ if (!current_user_can(‘edit_theme_options’) ) add_action( ‘admin_print_footer_scripts’,’openGallery_script’, 999); } function openGallery_script(){ ?> <script type=”text/javascript”> jQuery(function(){ jQuery(“.insert-media”).click(function (event){ var options = { … Read more

Sorting Media Library by Author Name

Order by the author’s display name: This is most likely by design, because the only information about the author in the wp_posts table is the author ID. We can join it with the wp_users table to get more information about the user and then modify the order accordingly. Here’s an example how we can order … Read more

Get image URL from media library “insert from url”

Got the solution…! Use fn.state(’embed’ insted of fn.on( ‘insert’ Or use Both of them fn.state(’embed’ & fn.on( ‘insert’ fn.state(’embed’).on( ‘select’, function() { var state = fn.state(), type = state.get(‘type’), embed = state.props.toJSON(); // SHOW JSON for embeded URL console.log(’embed’+JSON.stringify(embed)); });

wordpress not generate thumnails for mp4 videos

You can output them on the front end using custom fields like this: printf( ‘<a href=”https://wordpress.stackexchange.com/questions/258892/%s”><img src=”https://wordpress.stackexchange.com/questions/258892/%s” /></a>’, get_post_meta( get_the_id(),’video_url’, true ), the_post_thumbnail_url() ); Or this if you want to use a different image for your video thumbnail printf( ‘<a href=”https://wordpress.stackexchange.com/questions/258892/%s”><img src=”https://wordpress.stackexchange.com/questions/258892/%s” /></a>’, get_post_meta( get_the_id(),’video_url’, true ), get_post_meta( get_the_id(),’video_img’, true ) );

Slow/Not Working Media Library Search

The wordpress media library do not scale well especially when searching for images. I know there was some work done in trying to make it better in the latest versions but there are some fundamental problems (flat structure) that are unlikely to be resolved without some refactoring of the whole code. If this is an … Read more