Responsive Featured Images Not Working

It seems I forgot one crucial aspect: to edit the CSS of the img element. I set my img to: img { height: auto; max-width: 100%; vertical-align: middle; } That fixed the issue with regards to the images not being responsive.

Get a specific size from wp_get_attachment_image_src

Thanks maverick, your solution works <?php $args = array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘numberposts’ => 15, // -1, show all ‘post_status’ => ‘any’, ‘post_mime_type’ => ‘image’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’ ); $images = get_posts($args); if($images) { ?> <images> <?php foreach($images as $image) { ?> <image><![CDATA[<?php echo wp_get_attachment_image_src( $image->ID, ‘listing_gallery_2x’)[0]; ?>]]></image> <?php … Read more

Can i use my Old Post image URL in my new post?

When you upload an image into the media library, WordPress creates a new post of a special type. The title tag is stored as a post title, the caption as excerpt, the alt tag as a special field. So, if you call the image through the library it will know all the metadata. For instance, … Read more

Decide how Hero image appears on mobile

This is not the best practice, it seems you should have an image for desktop and another one for mobile in order to fit well the screen. However, you can set where to focus using the background-position CSS Property. .imgBackground { background-image: url(‘image’); background-repeat: no-repeat; background-attachment: fixed; background-position: center bottom; } Check this life example.

WP Large Images crash page

I suggest using a gallery plugin that will show thumbnail images and then load the large image after the thumbnail is clicked. I’ve seen this one used. Also, in most cases, 4000px images are not needed if your goal is only to let people see your photography. 1200px wide is plenty large enough. I would … Read more