Add email icon to page
-
Question from Richard Donovan, submitted via YouTube:
What if I wanted to put the email icon in the menu with a page? It doesn’t seem to work that way, when I put an url in, the icon goes away.
At least right now, Menus Social Icons works by detecting common addresses in link URLs, then matching them to an appropriate icon. Adding icons to additional pages can be done with the “Option: Add More Icons” example shown in the plugin description.
For example, if you wanted to add the email icon to a page with the slug “/contact” in your site, the code would be:
add_filter( 'storm_social_icons_networks', 'storm_social_icons_networks'); function storm_social_icons_networks( $networks ) { $extra_icons = array ( '/contact' => array( // Enable this icon for any URL containing this text 'name' => 'Email', // Default menu item label 'class' => 'envelope', // Custom class 'icon' => 'icon-envelope', // FontAwesome class 'icon-sign' => 'icon-envelope-alt' // May not be available. Check FontAwesome. ), ); $extra_icons = array_merge( $networks, $extra_icons ); return $extra_icons; }
This code would be added to your theme’s functions.php file.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Add email icon to page’ is closed to new replies.