Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1397465

    Hey!
    I wanted to add a custom Spotify & TikTok icon to my website header & footer. I already dowloaded the icon fonts from fontello, uploaded the zip files in my icon font manager, installed WPCode and added the php snippet for the Spotify social icon to appear and everything works smoothly.
    Then I tried adding a second php snippet for the TikTok font and I get this error message:

    Fatal error: Cannot redeclare avia_add_custom_icon() (previously declared in /homepages/41/d909207615/htdocs/app909207735/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(268) : eval()’d code:1) in /homepages/41/d909207615/htdocs/app909207735/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(268) : eval()’d code on line 1

    I don’t know how to solve this or where the error is. Is it possible to activate both social icons in 1 php code snippet? Or how can I make this work with two separate ones?

    #1397533

    Hi Tobias,

    Thanks for giving us admin access.
    I have modified the codes:
    Adding TikTok Social Icon

    // Register new icon as a theme icon
    function avia_add_tiktok_icon($icons) {
    	$icons['TikTok']	 = array( 'font' =>'tiktok', 'icon' => 'ue800');
    	return $icons;
    }
    add_filter('avf_default_icons','avia_add_tiktok_icon', 10, 1);
    
    // Add new icon as an option for social icons
    function avia_add_tiktok($icons) {
    	$icons['TikTok'] = 'TikTok';
    	return $icons;
    }
    add_filter('avf_social_icons_options','avia_add_tiktok', 10, 1);

    Adding Spotify Social Icon

    // Register new icon as a theme icon
    function avia_add_spotify_icon($icons) {
    	$icons['Spotify']	 = array( 'font' =>'spotify', 'icon' => 'uf1bc');
    	return $icons;
    }
    add_filter('avf_default_icons','avia_add_spotify_icon', 10, 1);
    
    // Add new icon as an option for social icons
    function avia_add_spotify($icons) {
    	$icons['Spotify'] = 'Spotify';
    	return $icons;
    }
    add_filter('avf_social_icons_options','avia_add_spotify', 10, 1);

    Please review your site.

    Best regards,
    Nikko

    #1397547

    Hey Nikko!

    Everything worked perfectly. Thank you so so much! You guys are awesome :)

    #1397551

    Hi,
    Glad Nikko was able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Multiple custom Social Icons for Header / Footer’ is closed to new replies.