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’ );

Replace original image, WP image editor

What you want is probably something like this. You need to manually unlink the original image including added sizes. The WP image editor automatically creates a new image with a new name as you mentioned but not others added through add_image_size() function. regenerate_added_sizes() in the code below does exactly that: function replace_original_images( $override, $filename, $image, … Read more

Woocommerce featured image of page – not product

Thanks to you I tried this on my functions.php It worked, but also had to get the ID of the page, in my case 4. add_action( ‘woocommerce_before_main_content’, ‘woocommerce_category_image’, 2 ); function woocommerce_category_image() { if ( is_product_category() ){ global $wp_query; $cat = $wp_query->get_queried_object(); $thumbnail_id = get_term_meta( $cat->term_id, ‘thumbnail_id’, true ); $image = wp_get_attachment_url( $thumbnail_id ); if … Read more

If I Regenerate Thumbnails, would WordPress delete the existing Thumbnails and replace them with ‘new copies’?

Here’s what you can do: Delete the Old Thumbnails Download and install the Thumbnail Cleaner plugin. This plugin will delete all of your current thumbnails. You can do this manually by writing a PHP snippet that detects thumbnails and deletes them, but it’s not really that necessary. Resize the Original Images Once you have deleted … Read more

Remove Size images without use

Yes, just search for a specific image size within the theme files. The text editors like Atom, BBEdit, Notepad++ allows to do that. P.S. You can find image size name in add_image_size() function argument.

Make medium_large images available to insert into post

since I’m using a size already generated by WP, I just needed to add: add_filter( ‘image_size_names_choose’, ‘fresh_custom_sizes’ ); function fresh_custom_sizes( $sizes ) { return array_merge( $sizes, array( ‘medium_large’ => __( ‘Medium Large’ ), ) ); }

Inserting HTML tag with ACF into shortcode

You have to use do_shortcode() to execute shortcodes in your string Full code should be like that <?php function my_shortcode( $atts ) { $atts = shortcode_atts( array( ‘post_id’ => ”, // Default value. ), $atts ); $output=”https://wordpress.stackexchange.com/questions/291524/[acf field=”image” post_id=”” . $atts[‘post_id’] . ‘”]’; $output = do_shortcode( $output ); $output=”<img src=”” . $output . ‘” />’; … Read more