Tag Info

New answers tagged

0

you need to have predefined image sizes, WP have 3 default sizes as 100x100 thumbnail, 300x300 medium and 800x800 large, and I have an aditional size called img-polaroid 700x320 defined on functions.ini. So the code to get images is: $image_id=get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,'img-polaroid'); ...


0

... leads me to believe wp_get_attachment_image_src( $thumb_id, array(100, 100) )[0] would return a 100x100 thumbnail... That isn't quite what happens. Most of the work is done by image_downsize() as you can see from near the top of the wp_get_attachment_image_src() : 692 // get a thumbnail or intermediate image if there is one 693 if ...


5

You need to define your arguments before you pass them to WP_Query, not after. Also, your meta_query should be an array of an array, not just an array This $query = new WP_Query($thumbs); $thumbs = array( 'meta_query' => array('key' => '_thumbnail_id') ); should look like this $thumbs = array( 'meta_query' => array( ...


0

I found the problem. For some reason it was a JPEG file's issue. I recreated all the JPEGs and now it generates the thumbnails...


1

I'm not completely sure that you do actually need get_terms() twice. It looks very ineffecient and overboard. I don't know if you need this for ordering purposes, but still, there are better ways of doing this without hitting the db so hard. One alternative is to make one call to get_terms() and then use usort() to sort your terms by parent. But this is ...


0

I think you have to follow Fighting Duplicate Image OR use Force Regenerate Thumbnails this plugin will remove all old image and generate new one OR if you choose that blog suggestion then it will have plugin with some detail wording. Feel free to contact me if any query/concern regarding this. Thanks!



Top 50 recent answers are included