• lelecarabina

    (@lelecarabina)


    Hi. I am trying to add some new icons to this plugin. I followed the instructions and was able to add the RSS and the User icons and also I was able to include the latest collection. Now I am trying to add more icons to the latest collection $networks_latest, but so far have not had any success. I need to add the SoundCloud icon to the mix and because it is from Font Awesome 4 I thought it should go inside $networks_latest. I reproduced the same process that was successful with the old collection ($networks), but no go.

    Am I doing something wrong? Here is my whole code for this plugin from my child-theme’s functions.php file.

    add_filter( 'storm_social_icons_use_latest', '__return_true' );
    add_filter( 'storm_social_icons_size', create_function( '', 'return "large";' ) );
    add_filter( 'storm_social_icons_networks', 'storm_social_icons_networks');
    
    function storm_social_icons_networks( $networks ) {
        $extra_icons = array (
            '/feed' => array(                  // Enable this icon for any URL containing this text
                'name' => 'RSS',               // Default menu item label
                'class' => 'rss',              // Custom class
                'icon' => 'icon-rss',          // FontAwesome class
                'icon-sign' => 'icon-rss-sign' // May not be available. Check FontAwesome.
            ),
            '/about' => array(                 // Enable this icon for any URL containing this text
                'name' => 'About',             // Default menu item label
                'class' => 'about',            // Custom class
                'icon' => 'icon-user',         // FontAwesome class
            ),
        );
        $extra_icons = array_merge( $networks, $extra_icons );
        return $extra_icons;
    }
    
    function storm_social_icons_use_latest( $networks_latest ) {
        $font_awesome_4 = array (
            'soundcloud.com' => array(                  // Enable this icon for any URL containing this text
                'name' => 'SoundCloud',               // Default menu item label
                'class' => 'soundcloud',              // Custom class
                'icon' => 'fa fa-soundcloud',          // FontAwesome class
                'icon-sign' => 'fa fa-soundcloud' // May not be available. Check FontAwesome.
            ),
        );
        $font_awesome_4 = array_merge( $networks_latest, $font_awesome_4 );
        return $font_awesome_4;
    }

    https://wordpress.org/plugins/menu-social-icons/

Viewing 3 replies - 1 through 3 (of 3 total)
  • rookdesigns

    (@rookdesigns)

    Hey I’m also trying to do this, any thoughts?

    I am also trying to do this! Can anyone help?

    Ok, I did some experimenting and this code finally worked for me-

    add_filter( 'storm_social_icons_networks', 'storm_social_icons_networks');
    function storm_social_icons_networks( $networks ) {
    
        $extra_icons = array (
            '/soundcloud' => array(                  // Enable this icon for any URL containing this text
                'name' => 'Soundcloud',               // Default menu item label
                'class' => 'fa fa-soundcloud',              // Custom class
                'icon' => 'fa fa-soundcloud',          // FontAwesome class
                'icon-sign' => 'fa fa-soundcloud' // May not be available. Check FontAwesome.
            ),
        );
    
        $extra_icons = array_merge( $networks, $extra_icons );
        return $extra_icons;
    
    }

    Hopefully it will work for both of you too.

    • This reply was modified 7 years, 5 months ago by homemadejam.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add Soundcloud and Other New Icons from Font Awesome 4’ is closed to new replies.