add_image_size for header_image

This may can help you add_theme_support( ‘post-thumbnails’, array( ‘post’ ,’promotions’, ‘services’, ‘counter’) ); set_post_thumbnail_size( 200, 200, true ); add_image_size( ‘slider-image’, true ); Image will resize according to your html code

Random Size on Featured Image

You can put the sizes into an array and use PHP’s array_rand to choose a random size: $sizes = array( ‘small’, ‘medium’, ‘large’ ); foreach( $pages as $page ){ $random_size = array_rand( $sizes, 1 ); echo get_the_post_thumbnail( $page->ID, $sizes[$random_size] ); }

Generating different dimension images while uploading image file from custom plugin page

Resized different dimension image sets are generated by using wp_generate_attachment_metadata and wp_update_attachment_metadata method. $absFilename = $wp_upload_dir[‘path’].”https://wordpress.stackexchange.com/”.$filename; $attach_data = wp_generate_attachment_metadata( $attach_id, $absFilename); wp_update_attachment_metadata( $attach_id, $attach_data ); This will update the image details in the wp_postmeta table. Thanks @DaveRomsey

WordPress – different icon image depends of comment number

There is a ready function for doing such action: Take a look here: https://codex.wordpress.org/Function_Reference/wp_count_comments This should really sole your problem as you can use an if statement deciding the picture, just remember you have to use the post_id in order to get the count. Thank you!

After installing ssl certificate images won’t show

I suppose you have Adaptive Images plugin installed? The author suggests for now: Can you check if the urls in your admin Settings > General page do contain the “https” instead of “http”? They should contain the “https” and (sorry about this inconvenience) you need to update your Adaptive Images settings one more time after … Read more

Is my code is right to make image shortcode

Your code is right just need to change $atts variable. // if you want to add image, alt attribute on shortcode statically $atts = shortcode_atts( array( ‘image_src’ => ”, ‘alt’ => ”, ‘add_img_class’ => ”, ‘id’ => ” ), $atts, ‘hero-banner’ ); // if you pass image and alt attribute dynamically $atts = shortcode_atts( array( … Read more

Adding new size for Media screen in functions.php not working

Change your function to this. function wpshout_custom_sizes($sizes) { $sizes[‘medium-width’] = __( ‘Medium Width’ ); $sizes[‘medium-height’] = __( ‘Medium Height’); $sizes[‘medium-something’] = __( ‘Medium Something’); return $sizes; } add_filter( ‘image_size_names_choose’, ‘wpshout_custom_sizes’ );