Uploading Images in the Link Manager

Well, started as a curiosity, ended up doing a plugin… : After finishing, I went to look in WordPress repository and…yes, there’s already one that does it: Easy Blogroll Image : At least, I took a different approach and did something different. Featured Link Image – [edit: released in the WordPress repository, link updated]

Change WordPress image URLs via filter

You will most likely want to use filters. The main issue is that developers will need to make sure to use the correct functions like “the_post_thumbnail()” etc. You can use wp_get_attachment_url https://codex.wordpress.org/Function_Reference/wp_get_attachment_url I use this when doing local development, but want all my local images to load from the Production server as I don’t have … Read more

Displaying images from external RSS feeds?

SimplePie, which ships with WordPress, does support images in feeds. Please see the SimplePie Reference if you need to look for specific functions regarding images. If you want to display images from feeds on your own site, you could for example create a plugin containing a custom widget that reads a feed for images. For … Read more

Delete the original big size image after upload and leave only 3 images crunched by media gallery

How about this: add_filter( ‘wp_generate_attachment_metadata’, ‘delete_fullsize_image’ ); function delete_fullsize_image( $metadata ) { $upload_dir = wp_upload_dir(); $full_image_path = trailingslashit( $upload_dir[‘basedir’] ) . $metadata[‘file’]; $deleted = unlink( $full_image_path ); return $metadata; } Not 100% sure everything will work ok without the main image, but it does the trick. You wont be able to regenerate the thumbnails / … Read more

Hide custom image sizes from media library

Using unset and intermediate_image_sizes_advanced will work but only on images uploaded after the function is added. To change it for existing images you need to regenerate them using a plugin ( in essence deleting that image size) or just hide that option from being visible. Tested on 3.5.1 // add custom image size function mytheme_95344() … Read more

Programmatically Set First Image as Featured

Regarding the code you posted, I would say some things: you can avoid using 6 different actions because one is enough: ‘save_post’ is triggered everytime a post is created or updated you can drop globalize $post: ‘save_post’ will pass the post id, you can use it, in addition, preparing the function to receive an argument … Read more

How to give image source in wordpress page editor?

You can define constant in theme function file as: if( !defined(THEME_IMG_PATH)){ define( ‘THEME_IMG_PATH’, get_stylesheet_directory_uri() . ‘/site/images’ ); } and then you can use img tag as <img src=”https://wordpress.stackexchange.com/questions/252559/<?php echo THEME_IMG_PATH; ?>/footLogo.png” style=”padding: 0px!important; color:white”>