Adjusting caption below single post image

Override The Image Caption With Image Title And Description Here’s a way to override the caption with the image title and image description, with a demo plugin. Let’s assume we have uploaded this image: Then we insert it into the editor with the following: Before: Without our plugin activated it will display as: After: With … Read more

Add visual editor to Media Edit Screen

This function added to functions.php does exactly that: // Enables Editor in Media edit screen. function add_editor_support_for_attachments($settings) { if( get_post_type() == ‘attachment’){ $quicktags_settings = array( ‘buttons’ => ‘strong,em,link,block,del,ins,ul,ol,li,code,close’ ); $settings = array( ‘wpautop’ => true, ‘textarea_name’ => ‘content’, ‘textarea_rows’ => 10, ‘media_buttons’ => false, ‘tinymce’ => true, ‘quicktags’ => $quicktags_settings, ); return $settings; } } … Read more

Featured Images on Front Page

Two categories should do the trick. Featured posts – This category should be applied to posts that you want to show on your home page, with that images grid. You can limit the number of posts (so only the, for example, 6 newest ones would appear) and select the featured image for them on each … Read more

Media sizes aren’t being created – server config?

It looks like “Easy Apache” handles both Apache and PHP. Only a guess, but you have recompiled Apache/PHP without the needed image libraries– either GD or ImageMagick. Without those, the server cannot physically resize images. You can use a phpinfo() script to see if the libraries are present. If not, you will need to recompile– … Read more

Hook for saving an image after editing

wp_save_image_editor_file filter fires after. add_filter( ‘wp_save_image_editor_file’, ‘custom_wp_save_image_editor_file’, 10, 5 ); function custom_wp_save_image_editor_file( $saved, $filename, $image, $mime_type, $post_id ){ //Your logic here return $saved; }

How to force WordPress to add new images at the beginning of the gallery?

I just fixed this after several hours of research. If one need to do the same thing, he must edit file wp-includes\js\media-views.js and replace add with unshift in this line (#2611, galleryAddToolbar): edit.get(‘library’).add( state.get(‘selection’).models ); So the code will look like this: edit.get(‘library’).unshift( state.get(‘selection’).models ); After that when you add images in the gallery they … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)