• Resolved fpats

    (@fpats)


    I added the code below to PHP as per the description, to add an RSS icon.
    Unfortunately it crashed the site returning errors so i’ve had to remove it.

    Have i missed a step or gone wrong somewhere?

    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.
            ),
        );
    
        $extra_icons = array_merge( $networks, $extra_icons );
        return $extra_icons;
    
    }

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    https://www.ads-software.com/plugins/menu-social-icons/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Paul Clark

    (@pdclark)

    Did you put your code after the <?php tag, as it should be? What was the error you got?

    Thread Starter fpats

    (@fpats)

    Yeah it’s in the right place, i’d already added some other PHP to use different sized icons.

    It’s just the front end that returns an error Fatal error: Cannot redeclare storm_social_icons_networks() (previously declared in.. ..theme/custom-functions.php on line 38

    check it here

    Plugin Author Paul Clark

    (@pdclark)

    That means you’re using the same function name twice —?you’ve either pasted the code twice, or used the same function name twice. Either remove the duplicate, or rename one of them. An example rename would change:

    add_filter( 'storm_social_icons_networks', 'storm_social_icons_networks');
    function storm_social_icons_networks( $networks ) {

    to:

    add_filter( 'storm_social_icons_networks', 'storm_social_icons_networks_2');
    function storm_social_icons_networks_2( $networks ) {

    I’ve just added _2 to the second name in add_filter and to the name after function.

    Thread Starter fpats

    (@fpats)

    OK thanks alot for your help. I’ve done that & the error’s gone.

    I cleared my cache and was expecting to find an RSS icon added to the links section under menus but there’s nothing there, nothing’s changed.

    Am i supposed to be doing something else here?
    Sorry to be a pain.

    Plugin Author Paul Clark

    (@pdclark)

    Go into WP Admin > Appearance > Menus and add a custom link to /rss

    Thread Starter fpats

    (@fpats)

    Thanks but that’s what I did.

    If i leave link text blank there’s no menu item, if i type in RSS it just adds a text menu item.

    The FB & Twitter icons work perfectly but this RSS link just isn’t working, at all.

    Thread Starter fpats

    (@fpats)

    Why has this been marked as resolved when i’m no further now than i was over a week ago?

    Not only is the RSS not working, by adding other social icons the plugin’s creating additional padding at the bottom of the menu that’s proving impossible to remove.

    I give in with this one, i’ll uninstall and stick the icons in the sidebar.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    It gets marked resolved when you or the plugin author marks it resolved. It’s your topic so you can un-resolve it on the right if you want.

    Plugin Author Paul Clark

    (@pdclark)

    Sorry, I meant /feed for the URL, not /rss. You can have anything for the title —?it’s the URL that matters.

    If that doesn’t work for you, can you share a temporary WordPress admin login and your site URL in brainstormmedia.com/chat?

    I’m going to sleep, but if you leave it there, I’ll see it when I wake up.

    Plugin Author Paul Clark

    (@pdclark)

    Hi fpats,

    Did changing to /feed resolve the issue for you?

    jalmond

    (@jalmond)

    This fix worked for me, although I have the same issue now with RSS that was fixed with Twitter in this thread.

    Could you tell me the function code to fix this? Thanks!!!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Add RSS’ is closed to new replies.