How might I retrieve a featured post image from an external WP site and display it as a link back?

Whenever I’m trying to link two sites, I find the most efficient and least destructive way is to use the WordPress XMLRPC API. http://codex.wordpress.org/XML-RPC_WordPress_API/Posts In this case, you could pull this info through using the built in IXR_Client library. This saves a ton of time writing code and trying to mix databases. If they wind … Read more

How can I display my featured image correctly inside my single posts?

As mentioned by Rahil Wazir, take that code snippet <?php the_post_thumbnail(); ?> away from single.php. Put following in your functions.php (at the bottom) add_filter(‘the_content’, ‘put_thumbnail_in_posting’); function put_thumbnail_in_posting($content) { global $post; if ( has_post_thumbnail() && ( $post->post_type == ‘post’ ) ) { the_post_thumbnail( ”, array( ‘style’ => ‘float:left;margin:15px;’ ) ); } return $content; } Change the … Read more

How to limit number of images being printer out in “Set Featured Image” pop up?

Update 1: After dived into core AJAX call, this filter will only happen on post.php page: add_filter(‘ajax_query_attachments_args’, function($query){ if ( isset($_POST[‘post_id’]) && !empty($_POST[‘post_id’]) ) { $query[‘posts_per_page’] = 10; // output 10 images only. } return $query; }); You can use ajax_query_attachments_args filter: add_filter(‘ajax_query_attachments_args’, function($query){ $query[‘posts_per_page’] = 10; // output 10 images only. return $query; }); … Read more

Featured image size in ADMIN panel?

You can filter ‘admin_post_thumbnail_html’ and replace the img element with a new one in the size you need. Everything else will get messy and might lead to side effects. Filtering image_downsize while watching for a size of 266×266 might affect images that are not meant to be shown in the metabox. Changing the size for … Read more

adding an id to the_post_thumbnail

Use get_the_post_thumbnail() instead. It allows you to pass in an array of attributes for the image tag that gets returned. For example: $attr = array( ‘id’ => ‘YOUR-UNIQUE-ID’, ); echo get_the_post_thumbnail( $id, ‘thumbnail’, $attr ); EDIT: I’m dumb. the_post_thumbnail() also lets you do that. Try passing the same args array I outlined as the second … Read more