Nice one!
By default NGFB will use the URL for the current webpage, which is an index, so you’ll have to tell it which URL to use. Try something like this:
<?php
if ( function_exists( 'ngfb_get_social_buttons' ) )
echo ngfb_get_social_buttons(
array( 'facebook', 'gplus', 'twitter' ),
array( 'url' => get_permalink( $post->ID ) )
);
?>
You could also add the following to your theme’s functions.php file:
add_filter( 'the_excerpt', array( 'ngfbPlugin', 'add_content_buttons' ) );
I *think* that should work…
Hm. This could easily be a checkbox option on the settings page… I’ll try and keep it in mind for the next version. 😉
js.
Thread Starter
Špela
(@cikorka)
Yay, I’m loving this plugin and its technical support more and more :).
I’ve tried both solutions: the code in the loop works like a charm :).
The other option (adding the filter to functions.php file) renders a parsing error (Parse error: syntax error, unexpected ‘;’ in /home/MySite/public_html/wp-content/themes/endurance-yoko/functions.php on line 367) though.
Love the idea of having the option on the settings page :)!
Thank you so much & have a wonderful day :)!
I wasn’t going to include any new features in 5.0, but what the heck, I sat down for a few hours this morning and wrote the code to include social buttons in the excerpt.
Would you mind testing it and letting me know if everything works as expected?
http://downloads.wordpress.org/plugin/nextgen-facebook.5.0rc2.zip
Thanks,
js.
Thread Starter
Špela
(@cikorka)
This is why I love WordPress – because of all the people who make it the warmest and most user-frienly platform out there :).
It works perfectly. Thank you, jsmoriss :)!.
FYI – There was a small recursion issue with the new excerpt button filter. Download and install the new 5.0rc3 version.
http://downloads.wordpress.org/plugin/nextgen-facebook.5.0rc3.zip
Thanks,
js.