Support » Theme: Twenty Twenty-One » Remove Social Icons in Menus

  • Resolved thunderfrog

    (@thunderfrog)


    Is there a way to remove a filter globally for social icons in filters. I am using a custom icon set and I can not get the theme to stop over riding it. I do like having them in a widget block generally (though not always), but would love some way to turn them off.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    Yes, what you want can be done with the following PHP …

    remove_filter('walker_nav_menu_start_el', 'twenty_twenty_one_nav_menu_social_icons');

    I will add this as an option to Options for Twenty Twenty-One plugin and update this thread when it’s done.

    Oliver

    Thread Starter thunderfrog

    (@thunderfrog)

    @domainsupport fantastic!

    Thread Starter thunderfrog

    (@thunderfrog)

    An update that just adding that to functions.php didn’t seem to do the trick unfortunately.

    That’s probably because your call to remove_filter() in functions.php is being fired before the theme’s add_filter().

    To resolve that, it needs to be added in a hook, something like …

    function twenty_twenty_one_remove_social_icons() {
    remove_filter('walker_nav_menu_start_el', 'twenty_twenty_one_nav_menu_social_icons');
    }
    add_action('after_setup_theme', 'twenty_twenty_one_remove_social_icons');

    … should do the trick by calling remove_filter() after the theme has loaded.

    Oliver

    This is now an option in Options for Twenty Twenty-One plugin …

    “Customizer – Footer Options – Remove Social Icons”

    Oliver

    Thread Starter thunderfrog

    (@thunderfrog)

    @domainsupport – brilliant! Thank you, using the hook did the trick. Thank you so much!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.