Hot answers tagged

2

Try this in your functions.php file: add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 200, 200 ); Read More: http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size


1

I'm guessing here, I'll edit/delete if I'm wrong Inspect the contents of $thumbnail and I bet you'll find a URI. From the documentation: Use absolute path and not the URI of the file.


1

In WordPress - Attachments are their own post-type which means you just need to update the post using wp_update_post(): $media_post = wp_update_post( array( 'ID' => $attachment_id, 'post_parent' => $post_parent_id, ), true ); if( is_wp_error( $media_post ) ) { error_log( print_r( $media_post, 1 ) ); } In the above you would ...


1

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 ...



Only top voted, non community-wiki answers of a minimum length are eligible