Responsive Images with art direction

The ‘picture’ element supports min-width and max-width. If the image is a featured image then wp_get_attachment_image_src is what you would use: // open the picture element <picture> // use this image if the width of a screen does not go over 599px <source srcset=”https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/<?php echo wp_get_attachment_image_src( get_post_thumbnail_id(), ‘whatever add_image_size you want to use’, false )[0] … Read more

Does WordPress have a way of changing the ‘Natural’ size of uploaded images?

WordPress has built in sizes for your photos that it automatically creates when you upland an image. You can call different ones by using get_the_post_thumbnail( $post_id, ‘thumbnail’ ); // Thumbnail (Note: different to Post Thumbnail) get_the_post_thumbnail( $post_id, ‘medium’ ); // Medium resolution get_the_post_thumbnail( $post_id, ‘large’ ); // Large resolution get_the_post_thumbnail( $post_id, ‘full’ ); // Original … Read more

Multi Photo Upload with Caption on Front End for Custom Post Type

WordPress stores the images as attachment post type, so it is possible to add the title to each of your gallery images. For example, // $filename should be the path to a file in the upload directory. $filename=”/path/to/uploads/2013/03/filename.jpg”; // The ID of the post this attachment is for. $parent_post_id = 37; // Check the type … Read more