• Resolved npsr26

    (@npsr26)


    Hello,

    I am using an image in the menu using Menu Image plugin v3.0.8 and WordPress v5.9.2

    Even if I select 24×24 in the menu for the size, the image is still full size.
    The attributes width=”24″ and height=”18″ are completely ignored.
    If I manually replace those attributes by style=”height:18px”, it is working correctly.

    What am I doing wrong?

    Thank you for your help.

    Regards,
    Nicolas

    • This topic was modified 2 years, 11 months ago by npsr26.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter npsr26

    (@npsr26)

    The CSS from the “Colinear” theme and from “block-library” seem to prevent the resizing with a “height: auto;”

    • /wp-content/themes/colinear-wpcom/style.css?ver=5.9.2
    • /wp-includes/css/dist/block-library/style.min.css?ver=5.9.2
    • Is there a way to override this? Maybe forcing “Menu Image” to put the height and width in a “style” attribute?

      I am not a CSS expert ??

    Plugin Author Rui Guerreiro

    (@takanakui)

    Hi @npsr26,

    Sorry for the delay. Can you let me know your site URL so I can see if there is any CSS I can provide?

    Thanks

    Thread Starter npsr26

    (@npsr26)

    Hi @takanakui,

    Thank you for taking the time to answer me.

    There was an incompatibility between the plugin and the theme “colinear” because if I added the following additional CSS to my theme it was working:
    img.menu-image {
    height: 10px;
    }
    The theme CSS was kind of overriding the size setting of the plugin.

    In the end, I uninstalled the plugin and code my own quick and dirty plugin to hook the right call to add the icons in menu items based on the CSS id inserted in the menu items.
    function patch_navigation_label( $title, $item, $args, $depth ) {
    […]
    }
    add_filter( ‘nav_menu_item_title’, ‘patch_navigation_label’, 10, 4 );

    Thank you for the plugin still! And I hope my analysis will help the plugins to be compatible with more themes.

    Regards,
    Nicolas

    • This reply was modified 2 years, 10 months ago by npsr26.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Image not resized’ is closed to new replies.