Hello r00ster,
Please try this instead:
'slideshare' => array(
'name' => 'Slide-share',
'icon' => 'slideshare',
'link' => 'http://www.slideshare.net/customer_id'
)
and also please use add_filter
Best regards,
Spyros
Thanks for the reply.
What do you mean by add_filter?
I replaced ‘code’ with ‘slideshare’ and now the link is working but there’s still no icon inside the circle. Also, how to make the browser window open as ‘normal’ size instead?
Hello r00ster,
You may read about add_filter here: http://codex.wordpress.org/Function_Reference/add_filter
I have two apply_filters in the code that will make possible to add your code in the icons array.
Can you please post a link to your site. I may be able to debug.
To make the icons behave as normal links please use this code in the functions.php of your theme:
function rooster_dequeue_script() {
wp_dequeue_script( 'wpfai_js' );
}
add_action( 'wp_print_scripts', 'rooster_dequeue_script', 100 );
Thanks spyrosvl!
Links open correctly now, but I’m still having trouble using add_filter. How should I use this code?
Here’s a link to my site
Hello r00ster,
This should do the trick:
function my_slideshare_icon($wpfai_socialmedia) {
$wpfai_socialmedia['slideshare'] = array(
'name' => 'Slide-share',
'icon' => 'slideshare',
'link' => 'http://www.slideshare.net/customer_id'
);
return $wpfai_socialmedia;
}
add_filter('wpfai_array_filter', 'my_slideshare_icon', 99, 1);
Please try to understand the code if you are a developer. If you are not just paste it in your functions.php of your child theme.
About the icon not displaying. The plugin custom facebook feed pro is loading font awesome already, but the version is older (4.0.3). The slideshare icon was not there in this version. My plugin is designed to not load the font awesome library if it is already there.
You can either hack my plugin and delete/comment out lines 437 & 440, but you will need to do this everytime the plugin gets updated or you can remove the outdated font awesome library with something like this in the functios.php file of your theme:
wp_dequeue_style('cff-font-awesome');
or you can remove the cff plugin π
I hope I was helpful.
Best regards,
Spyros
Hello spyrosvl,
You’re right about cff plugin. I tried turning it off and it worked. But the problem isn’t solved yet since I still need to use CFF.
I tried reinstalling both plugins and adding
'slideshare' => array(
'name' => 'Slide-share',
'icon' => 'slideshare',
'link' => 'http://www.slideshare.net/customer_id'
)
to your plugin. Everything else is working fine but the Slideshare icon is still not on my homepage, only empty circle is displayed. I can see the icon on the plugin settings page though.
Hello r00ster,
Indeed, nothing is going to be fixed even by reinstalling the plugins. Yes the icon may be available in wp-admin.
I suggest you follow my instuctions posted above to fix this.
Best regards,
Spyros
P.S. or ask cff authors to update the font-awesome library of their plugin and release an update.
Thanks spyrosvl
I commented lines 437 and 440 and everything is working just fine.
Here’s the piece of code for those who have the same problem
/********** add to selected positions END **********/
// load font awesome or not
function wpfai_load_scripts () {
//if (wpfai_check_css('font-awesome.css') == 0 && wpfai_check_css('font-awesome.min.css') == 0 && get_option('wpfai_loadfa') == 'yes') {
wp_register_style( 'wpfai_font-awesome', plugins_url( '/wp-font-awesome-share-icons/fontawesome/css/font-awesome.min.css' ) );
wp_enqueue_style( 'wpfai_font-awesome' );
// }
Thanks for help and great plugin spyrosvl!
You are welcome r00ster.
Thank you for using the plugin.
Please remember to comment the lines again after the next plugin update.
Hello, sorry to dig up an old thread, but I have tried to add a custom print icon via functions.php without any success. It works fine if I add it directly to wp-font-awesome.php. Here’s the code:
//add a printer icon to the Font Awesome social sharing plugin
function my_print_icon($wpfai_socialmedia) {
$wpfai_socialmedia['print'] = array(
'name' => 'Print',
'icon' => 'print',
'link' => 'javascript:window.print()'
);
return $wpfai_socialmedia;
}
add_filter('wpfai_array_filter', 'my_print_icon');
Thank you so much, I love what this plugin can do and so want it to work!
Hi rudegoose!
I also was trying to add a custom print icon and your code did exactly what I was searching for.
Thanks!
You made my day! π
Regards,
Chipy
Hi Chipy, that’s fantastic thanks so much for letting me know. Just be careful to keep a copy of the edited file because it will be overwritten if you upgrade the plugin. That’s why I was trying to find a way to add it to the theme functions file instead.
Thanks for your reply, rudegoose!
Unfortunately, as posted already here, I have some really unexpected behaviour of the print icon among different browsers.
Maybe you do know why this happens?
Thanks again in advance about a timely response!
Regards,
Chipy