Tag Info

New answers tagged

0

You can actually set and use custom thumbnails using this code in your functions.php, modified appropriately of course. add_image_size( 'a', 80, 80, true ); // Hard Crop add_image_size( 'b', 120, 120 ); // Soft Crop add_image_size( 'c', 590, 9999 ); // Unlimited Height Mode Details: Post Thumbnails on the Codex Also a good resource: WPBeginner


2

If you want to use get_attached_media(), you can try for example: if( has_post_thumbnail() ) { the_post_thumbnail(); } else { $imgs = get_attached_media( 'image' ); if( count( $imgs ) > 0 ) { $img = array_shift( $imgs ); echo wp_get_attachment_image( $img->ID, 'thumbnail' ); } } to display one of the attached ...



Top 50 recent answers are included