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

Extend the WP_Customize_Image_Control class to change its non-frame $button_labels

Finally, I found how to change the non-frame $button_labels of a WP_Customize_Image_Control by extending its class, not reassigning a new $type and implement an enqueue() function to enqueue a pure JavaScript code to manipulate the non-frame labels, like this to change the dynamic ‘default’ label by .addEventListener(“click”, handler) to its dynamic .button: class WP_Customize_Custom_Control extends … 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

Issue uploading images

Are your WordPress URL and Site Address URL the same? I had a similar issue whereby one had a backslash and the other didn’t which caused it. Also, could you try inspecting the element in Chrome or Firefox and seeing where the URL points? Can you get to this URL directly from the browser?

Featured images are cropped on index and post page

This is likely a tweak the theme author made to make the images in the theme responsive or adaptive. You may want to look at adding “min-height” to your CSS and this should address your problem. https://css-tricks.com/almanac/properties/m/min-height/ Also another thing to note if you using “100%” anything the actual dimension is governed by the parent … Read more