Fixing external image urls

Since the request is sending to the blogspot server, no .htaccess wont wont. You could filter your post content output: add_filter(‘the_content’, function($the_content) { return str_replace(‘/s400′,’/s1600′,$the_content); }); Or you could edit modify the database global $wpdb; $wpdb->query(“UPDATE $wpdb->posts SET `post_content` = REPLACE(`post_content`,’/s400′,’/s1600′);”); Or do it in mysql UPDATE wp_posts SET `post_content` = REPLACE(`post_content`,’/s400′,’/s1600’; assuming wp_posts is … Read more

Can WordPress resize BMP files?

No, wordpress can not resize BMP files. Beware that it does not make sense to use BMP files in a website because a broad number of webbrowsers is not able to display them. Filetypes that are supported by WordPress and which are widely supported by internet browsers are: GIF, JPG and PNG. Those formats are … Read more

Black and White thumbnails

You can use the php GD library which you most likely already have on your server since wordpresses uses it. You can filter the image using imagefilter specifically IMG_FILTER_GRAYSCALE and/or IMG_FILTER_CONTRAST. For example imagefilter($im, IMG_FILTER_GRAYSCALE); imagefilter($im, IMG_FILTER_CONTRAST, -100); The hover would have to been done in javascript. A much simpler solution would be to use … Read more

Creating a rotating header /image slider using theme customization

We can do that! First, you’ll need to add a custom section on the Theme Customizer, containing all the image uploads (we’ll use 3 for this example): add_action( ‘customize_register’, ‘themename_customize_register’ ); function themename_customize_register($wp_customize) { $wp_customize->add_section( ‘slides’, array( ‘title’ => ‘Slides’, ‘priority’ => 25, ) ); $wp_customize->add_setting( ‘first_slide’, array( ‘default’ => ”, ) ); $wp_customize->add_control( new … Read more

Permanently remove first image from posts

Just as @s_ha_dum suggests, you can loop through all of your posts and update the content of each one. The following gives you the idea but is untested: $posts = get_posts( array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 500, ‘offset’ => 0, ) ); foreach( $posts as $post ): // Update each post with your reg-ex … Read more

Get attachment ID of author_meta image – Attachment Metadata

I suggest you to use the more newer media manager dialog; WordPress will hanlde all the image upload stuff, including generating intermediate sizes and attachement metadata. Here a working example (it is a quick example built from a previous code, it may needs some tweaks to be used on production): add_action( ‘admin_enqueue_scripts’, ‘load_wp_media_files’ ); function … Read more