Remove title attribute from images

I would strongly discourage this. A better, more sustainable practice would be to educate your clients on the value of the title attribute and teach them how to use it properly. Simply removing it is putting a bandage on the symptom, not combating the disease. However, if you do want to remove the attribute anyway, … Read more

Default Image Link Removal

This is not able to be changed through a filter. In WordPress 2.9.2 and lower, the setting can be changed in /wp-admin/options.php. The image_default_link_type field is set to “file” by default. If you set it to “none”, then scroll to the bottom and save, it will disable media links. This option has been removed from … Read more

How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?

You should echo it and also you are closing your php tag improperly. View source the o/p generated to get some idea img<src=<?php echo get_template_directory_uri().”/assets/img/flexslider/flex-1.jpg”?> alt=”alternative_name”> or you can use bloginfo which is easier to remember and use (You need not echo) <img src=”<?php bloginfo(‘template_url’); ?>/assets/img/flexslider/flex-1.jpg”/>

Resizing all images

I asked a similar but broader question, and I still need to research and write a complete answer. In the meantime here are some pointers that might help you: I wrote a set of plugins that resizes all images to the size used in the editor. It works by converting <img src=”https://wordpress.stackexchange.com/questions/4984/image.jpg” width=”200″ height=”400″/> to … Read more

Modifying an uploaded image with ‘wp_get_image_editor’ and ‘wp_handle_upload_prefilter’

I decided to approach it differently. Instead of hooking into ‘wp_handle_upload_prefilter’ and tampering with the $file variable I decided to do the resize after the file is uploaded and after I get the attachment id like this: public function resize_attachment($attachment_id, $width, $height) { // Get file path $file = get_attached_file($attachment_id); // Get editor, resize and … Read more