• Resolved rashid8

    (@rashid8)


    Hi, I have been testing this plugin on my theme which has nothing to do with woocommerce, it seems it is not working. I know the plugin’s name has woocommerce in it, but I just wanted to make sure is it suppose to work on other themes that do not have woocommerce installed?

    Appreciate your reply and thank you in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Nabil Lemsieh

    (@nlemsieh)

    Hi @rashid8

    Yes, it does work with non-product images. Since at this time there’s no visual setting to choose which non-product images to resize, you can use this workaround:

    Example: to resize blog images, add this code snippet:

    add_filter('wp_sir_resize_post_type', function($post_types){
    $post_types = (array) $post_types;
    $post_types[] = 'post';
    
    return $post_types;
    
    });

    The code snippet above will tell the plugin to process any images attached to blog posts.

    For other images, replace 'post' in the code snippet above with your custom post type.

    To resize any image in your website, add this code snippet instead:

    add_filter('wp_sir_is_attached_to', '__return_true');

    Let me know if you have any further questions.

    Thread Starter rashid8

    (@rashid8)

    Thanks for the reply @nlemsieh

    Perfect! Tested the above code and now it is working exactly as I wanted.

    Pro user incoming ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Does it work on non woo-commerce websites?’ is closed to new replies.