• Resolved Nick Lewis

    (@nickylew)


    Hi,

    Trying out your plugin as it looks really useful!

    I had tried using your filter in my functions file in order to change/replace the default image size brought in by the plugin.

    It doesn’t seem to be having any effect for me.

    My code here:

    add_filter( 'menu_image_default_sizes', function($sizes) {
    
      // remove the default 36x36 size
      unset($sizes['menu-36x36']);
      unset($sizes['menu-36x22']);
    
      // add a new size
      $sizes['menu-250x150'] = array(250,150);
    
      // return $sizes (required)
      return $sizes;
    
    });

    I even used another plugin to help refresh out the thumbnails, but that had no effect either.

    Any thoughts as to why this wouldn’t be working?

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Rui Guerreiro

    (@takanakui)

    Hi @nickylew,

    I tested your code and it seems to be working fine.
    https://cl.ly/ed1b7e87366c

    Did you add it to the bottom of the functions.php of your child theme before the php closing tags?

    Thread Starter Nick Lewis

    (@nickylew)

    Hi @takanakui

    Thanks for the reply.
    The filter wasn’t at the end of the functions file no. There were other filters, actions etc below it.

    I’m not at my computer at this time so I can check it and test it tomorrow putting it at the end of the end.

    Will update tomorrow!

    Plugin Author Rui Guerreiro

    (@takanakui)

    Ok @nickylew . Give it a try.
    In the meantime, I’m adding new setting fields to manage that situation visually. Will probably deploy the new version tomorrow.

    This is a screenshot so you can get the idea.
    https://cl.ly/4a75f9889d70

    Let me know your opinion, maybe it’s missing an option to enable/disable the custom image sizes?

    Thanks

    • This reply was modified 4 years, 8 months ago by Rui Guerreiro.
    Thread Starter Nick Lewis

    (@nickylew)

    Hi @takanakui

    I had a go with dropping the filter at the end of the functions file but it didn’t seem to have any effect again.

    I like the idea of a dashboard based image size option. Would make it easier to alter image sizes for a large spectrum of users, especially those who aren’t comfortable with code.

    An option to enable custom sizes might be a good idea, as not everyone will need that ability. But it would be a great feature to have!

    Please keep me informed so I can try it out

    Plugin Author Rui Guerreiro

    (@takanakui)

    @nickylew I just released the new version 20 minutes ago.

    Give it a try, after changing the custom image sizes you need to regenerate the thumbnails.

    Thread Starter Nick Lewis

    (@nickylew)

    Hey @takanakui

    Thanks for the lightening fast reply!

    I updated, changed the image sizes and regenerated the thumbnails.
    I found that I also had to go back into the menu and re-assign/remove and re-choose the images associated with the menu items before the images updated.

    But, after doing that, it works great!

    Thanks very much!

    Plugin Author Rui Guerreiro

    (@takanakui)

    No problem. I’m glad it’s sorted.
    Yes, it’s necessary to choose the new size.

    Thread Starter Nick Lewis

    (@nickylew)

    Great. Again, thanks for this solution, working great.

    Maybe it might be worth adding that into the description along with the text to prompt users to regenerate the thumbnails?

    Plugin Author Rui Guerreiro

    (@takanakui)

    Thanks for the suggestion. Will do that.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Custom image size not working’ is closed to new replies.