I have a front end form to let users upload images to my website and i set the post attachment image like this:
// find the most recent attachment for the given post $attachments = get_posts( array( 'post_type' => 'attachment', 'numberposts' => 1, 'order' => 'ASC', 'post_parent' => $new_post ) ); $attachment = $attachments; // and set it as the post thumbnail set_post_thumbnail( $new_post, $attachment->ID );
It's working... but i want to set/force the size of the image to be ('my-size') so i created this custom size:
add_image_size( 'my-size', 615, 9999 );
But i don't know how to set it up...
How can i accomplish this?