PHP crashes if you try to define two functions with the same name.
For multiple extra icon definitions, append more items to the array:
add_filter( 'storm_social_icons_networks', 'storm_social_icons_networks');
function storm_social_icons_networks( $networks ) {
$extra_icons = array (
// One Icon
'/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.
),
// another icon
'/url' => array( // Enable this icon for any URL containing this text
'name' => 'Name', // Default menu item label
'class' => 'classsssss', // Custom class
'icon' => 'icon-classsssss', // FontAwesome class
'icon-sign' => 'icon-classsssss-sign' // May not be available. Check FontAwesome.
),
);
$extra_icons = array_merge( $networks, $extra_icons );
return $extra_icons;
}
Thread Starter
jenp99
(@jenp99)
Ok thank you! I thought I had tried this in my list of guesses but it hasn’t crashed this time so perhaps not.
The podcast icon isn’t appearing. I suspect from reading the developer information it may be because it’s an earlier version of the fontawesome icons?
I have added the additional code to the file and it still isn’t working. Do I need to download or update the library to see the podcast icon?
The code I have in the themes custom.php file is:
add_filter( ‘storm_social_icons_use_latest’, ‘__return_true’ );
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.
),
‘/podcast’ => array( // Enable this icon for any URL containing this text
‘name’ => ‘PODCAST’, // Default menu item label
‘class’ => ‘podcast’, // Custom class
‘icon’ => ‘icon-podcast’, // FontAwesome class
‘icon-sign’ => ‘icon-podcast-sign’ // May not be available. Check FontAwesome.
),
);
$extra_icons = array_merge( $networks, $extra_icons );
return $extra_icons;
}
Thread Starter
jenp99
(@jenp99)
Sorted this but the update of icons? @pdclark
Yes, see the readme.
There’s a filter for switching to the latest Font Awesome version.
Here’s the filter in the readme and its use in code.
Here’s the line the filter affects.
-
This reply was modified 3 years, 3 months ago by
Paul Clark.