New answers tagged

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.


0

This probably has to do with the ImageMagick library that WP normally uses to resize images. I'm not sure whether it is possible to modify the standard settings WP applies, but it is possible to define your own. Here is a tutorial for that. You would have to replace the filter in that tutorial with one of your own using ImageMagick's interface. But that's a ...


0

Not sure I 100% follow what you trying to do, but you may have better luck if you try fiddling with the crop position. But it's odd you are saying cropping from the top left, as default crop position is center and center. add_image_size( 'featured-image-2', 640, 200, array( 'center', 'bottom' ) ); // Hard crop center bottom The first value in the array is ...


0

In your functions.php you want to issue a call to set_post_thumbnail_size() https://codex.wordpress.org/Function_Reference/set_post_thumbnail_size As with add_image_size, you provide the target width, height & whether you want the image hard cropped to these dimensions. So, for example, set_post_thumbnail_size(427, 427, true); will crop all your ...


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


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

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


0

It looks like the old images are available at eg. http://www.homecredit.ph/files/News-TN-23.png While the site is trying to search for them at eg. www.homecredit.ph/wp-content/uploads/News-TN-23.png There's two issues here: for some reason, your theme is requesting the images without the http:// before them; and it looks like you previously had a custom ...



Top 50 recent answers are included