How can I set different banner images using background cover at different breakpoints?

The way I would do this would be to inline the background: url(…) property. <?php if ( has_post_thumbnail() ) : $hero = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘hero’, ” ); $tablet = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID), ‘tablet’, ” ); $phablet = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘phablet’, ” ); $phone = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘phone’, ” ); ?> <style> @media only screen and … Read more

Duplicate images in wordpress

Its really looks like templates in your news-events section are use Featured image, and next (a same as first image) – just inserted into post body contents as Image. I Suggest you to remove featured image ( but not to delete it from wp), in this case you will avoid using duplicated image, un till … Read more

all images of past post messed up after changing theme

Alignleft looks like it’s behaving itself exactly as it should: aligning the image left and the text to the right of it. If you want your left aligned images to behave the same way as you ‘align none’ image, simply go to your style.css and remove ‘float:left’ from your .alignleft code: .alignleft { float: left; … Read more

How do i replace the title attribute of img tag with the image caption

// Replace the title of img tag with image caption function wpdocs_filter_gallery_img_atts( $atts, $attachment ) { $attachment = get_post( $attachment->ID ); if ( $caption = $attachment->post_excerpt) { $atts[‘title’] = $caption; } return $atts; } add_filter( ‘wp_get_attachment_image_attributes’, ‘wpdocs_filter_gallery_img_atts’, 10, 2 ) This function is working for me local host but some how not working on the … Read more

set specific dimension or minimum upload size [duplicate]

Add these code to your theme function file. add_image_size(‘mythumb’, 350, 200, array( ‘left’, ‘top’ )); // third parameter is for cropped option, you can change that as your preference. the_post_thumbnail( ‘mythumb’ );// image with the new dimensions. Important: you need to regenerate thumbnails to make this work. You can use plugin for that. For complete … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)