• Yeah…

    I’m not too sure what’s going on here since my experience is that with every other WordPress theme is that you can just add some HTML to the menu and it’ll display on the front end.

    I’ve tried adding both <i> and <span> class="material-icons" before the label (just the way you would normally add an icon according to the material documentation). Not seeing any options in the plugin. I’ve tried disabling the plugin and just enqueueing the material scripts and css files to debug. That didn’t work either.

    Don’t particularly want to add the functionality in by altering the material theme files since I’m developing with a child theme right now and I’d have to edit that class-menu-drawer-walker file under the inc directory in the main theme.

    Not too sure if you’re supposed to add and edit those files in the inc directory when it comes to child theme development…

    If anyone’s got any thoughts or ideas I’d love to hear them.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Utkarsh

    (@utkarshpatel)

    Hello @nathandonnelly,

    Thank you for your feedback!

    We are checking this internally, meanwhile you can try this patch to add icon: https://gist.github.com/PatelUtkarsh/5fe03e0f53666824c911b9c5d9222a8f

    1. Overrides default menu walker with custom walker, which injects markup required by material tabs with icon. See https://material.io/components/tabs/web#basic-usage (See functions.php and custom_walker.php)

    2. Insert menu text which expects content inside class mdc-tab__content => <span class="mdc-tab__icon material-icons" aria-hidden="true">home</span><span class="mdc-tab__text-label">Home</span>

    3. Add CSS for icon to appear in correct color.

    Let us know if you face any issues.

    Cheers!
    Utkarsh

    Thread Starter nathandonnelly

    (@nathandonnelly)

    While I haven’t looked into it too much, this breaks the website.

    Even while commenting out the rest of the functions.php file so it only contains the contents of yours (and there’s not much in mine, just enqueuing parent style, enabling SVG support and removing archive prefixes).

    Custom Walker was placed in this directory in the child theme (also tried it once in the root directory of the theme before I saw this line trying to debug).
    require_once get_template_directory() . '/inc/custom_walker.php';

    If you want anything from my end just let me know.

    Thanks,
    Nathan

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘No Ability to Add Material Icons to Drawer Menu?’ is closed to new replies.