• ResolvedPlugin Author Paul Clark

    (@pdclark)


    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)
  • It didnt seem to work, in my functions.php file. It says

    <?php
    define(‘PUNCH_FUNCTIONS’, TEMPLATEPATH . ‘/functions/template’);
    define(‘PUNCH_JAVASCRIPT’, get_template_directory_uri() . ‘/js’);
    define(‘PUNCH_CSS’, get_template_directory_uri() . ‘/css’);

    /* Core Theme Functionality */
    require_once(PUNCH_FUNCTIONS . ‘/theme_pluginsnotice.php’);
    require_once(PUNCH_FUNCTIONS . ‘/theme_support.php’);
    require_once(PUNCH_FUNCTIONS . ‘/theme_functions.php’);
    require_once(PUNCH_FUNCTIONS . ‘/theme_pagination.php’);
    require_once(PUNCH_FUNCTIONS . ‘/theme_breadcrumbs.php’);

    /* JavaScripts, Widgets, Sidebars, Shortcodes */
    require_once(PUNCH_FUNCTIONS . ‘/theme_javascript.php’);
    require_once(PUNCH_FUNCTIONS . ‘/theme_widgets.php’);
    require_once(PUNCH_FUNCTIONS . ‘/theme_sidebars.php’);
    require_once(PUNCH_FUNCTIONS . ‘/theme_shortcodes.php’);

    /* Post Comments, Custom Post Types */
    require_once(PUNCH_FUNCTIONS . ‘/theme_post_comments.php’);
    require_once(PUNCH_FUNCTIONS . ‘/theme_post_customtypes.php’);

    /* Page Options */
    require_once(PUNCH_FUNCTIONS . ‘/theme_page_options.php’);

    /* Site Options*/
    require_once(PUNCH_FUNCTIONS . ‘/theme_admin_panel.php’);

    ?>

    Plugin Author Paul Clark

    (@pdclark)

    Add the code anywhere between <?php and ?>, then change /contact to match the address of your page.

    Have you done both of those things?

    Yes, it worked, thank you. Can I add something to make the icon smaller

    Plugin Author Paul Clark

    (@pdclark)

    Yes. Watch the second video in the plugin description, under the heading “Changing Icon Appearance”.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add email icon to page’ is closed to new replies.