Tagged: site crash, social profiles, tripadvisor, Yelp
-
AuthorPosts
-
June 6, 2019 at 5:43 pm #1108012
Hello,
I’ve followed the directions to add two new icons to Social Profiles, Yelp and TripAdvisor, but when I add the code to the Child’s function.php, the site crashes after a few minutes. After I add the code, the WP message says the message was saved with the green checkbox. Luckily I saved a backup prior to adding everything so I just revert back to the starting point, but I’m perplexed why the site is doing this.
Enfold Child
Version 4.5.7
I also properly added the two icons (Font: Fontello) into Theme Options > Import/Export (should I have done this even though the icons are already installed by default?)Here’s the code that I added to Appearance > Theme Editor > functions.php
Yelp
// Register new icon as a theme icon
function avia_add_custom_icon($icons) {
$icons[‘yelp’] = array( ‘font’ =>’fontello’, ‘icon’ => ‘uf1e9’);
return $icons;
}
add_filter(‘avf_default_icons’,’avia_add_custom_icon’, 10, 1);// Add new icon as an option for social icons
function avia_add_custom_social_icon($icons) {
$icons[‘Yelp’] = ‘yelp’;
return $icons;
}
add_filter(‘avf_social_icons_options’,’avia_add_custom_social_icon’, 10, 1);TripAdvisor
// Register new icon as a theme icon
function avia_add_custom_icon($icons) {
$icons[‘tripadvisor’] = array( ‘font’ =>’fontello’, ‘icon’ => ‘uf262’);
return $icons;
}
add_filter(‘avf_default_icons’,’avia_add_custom_icon’, 10, 1);// Add new icon as an option for social icons
function avia_add_custom_social_icon($icons) {
$icons[‘TripAdvisor’] = ‘TripAdvisor’;
return $icons;
}
add_filter(‘avf_social_icons_options’,’avia_add_custom_social_icon’, 10, 1);Prior to the site crashing, the names never appeared in Social Profiles. Here’s the message I received once it did crash. Once I saw this after the third time, I reinstalled the backup again and decided to reach out.
Logins are below. Thanks for your time!
June 6, 2019 at 7:23 pm #1108062I figured out why it didn’t work. I remembered Mike mentioning in another thread to make sure the apostrophe’s need to be straight. Mine were curly. After updating the apostrophe’s, the Yelp code worked, but the TripAdvisor code did not. It crashed the site like before.
Still need help to add TripAdvisor. Thanks
June 8, 2019 at 10:59 pm #1108500Hi,
Sorry for the late reply, I have taken a look at your site and since it has been crashing, please include FTP access in the Private Content area, so we can try to install this for you.Best regards,
MikeJune 8, 2019 at 11:33 pm #1108503Yeah, I tried again this morning and it crashed again. Can’t figure it out, so thanks Mike!
June 9, 2019 at 12:25 am #1108508June 9, 2019 at 12:37 am #1108510See below
June 9, 2019 at 2:12 am #1108519June 13, 2019 at 4:41 pm #1109914Hi,
I need also TripAdvisor icons in Social Profiles.
Can you help me about it?
BR.
June 14, 2019 at 5:01 am #1110189Hi mierabt,
Please open a new thread and include WordPress admin login details in private so that we can have a closer look at your site.
Best regards,
RikardJune 20, 2019 at 10:43 am #1111891Hello Rikard,
Thank for your reply.
I opened new thread, case number #1111360. Please help me about it.
Thank you.
June 20, 2019 at 11:02 am #1111904First : use the code tag to post code here on board. Then we can see if you are using correct Brackets, Quotationmarks etc. pp.
And: it can be copy/pasted to proove or to insert it where you like.
Second : A function name should be always unique in your functions.php ! : with your code on top, you violated that rule.
(But on newer WP Versions the site should crash – it has some warnings on the bottom and does not save the changings – so ? )you can shorten your code above to:
// Register new icon as a theme icon function avia_add_custom_icon($icons) { $icons['yelp'] = array( 'font' =>'fontello', 'icon' => 'uf1e9'); $icons['tripadvisor'] = array( 'font' =>'fontello', 'icon' => 'uf262'); return $icons; } add_filter('avf_default_icons','avia_add_custom_icon', 10, 1); // Add new icon as an option for social icons function avia_add_custom_social_icon($icons) { $icons['Yelp'] = 'yelp'; $icons['TripAdvisor'] = 'TripAdvisor'; return $icons; } add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);
your font is named really : fontello ? – so you didn’t enter on top of fontello site a font-name?
June 20, 2019 at 3:11 pm #1111961Hey Geunni007,
Thanks for taking the time to post this but I think Mike has already taken care of adding the TripAdvisor icon to the site. Sorry to have wasted your valuable time on this but I just checked the site and it’s appearing in the list of icons, so this thread can be closed.
June 20, 2019 at 7:16 pm #1112067Hi eskitaco,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
VictoriaJune 21, 2019 at 10:45 am #1112282But the hint with the double function name can still be internalized, right?
Especially because some of the snippets offered here often have the name: ava_custom_scriptJune 21, 2019 at 10:48 pm #1112443Hi,
Thank u for the tip! Those always perfect ;)
Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.