Displays share buttons in pages, posts, widgets or .php files.
Contents
Installation
- Download Plugin
- In your admin panel, go to Plugins > and click the Add New button.
- Click Upload Plugin and Choose File, then select the Plugin’s .zip file. Click Install Now.
- Click Activate to use your new Plugin right away.
Usage
Use shortcode to display share buttons in your post, page or widget:
[bs-share-buttons]
Use shortcode to display share buttons in your .php
files:
<?php echo do_shortcode("[bs-share-buttons]"); ?>
Remove buttons you do not want to display directly in main.php
line 77
to 89
by deleting the respective line or override them by display: none;
. Use following classes:
.btn-twitter
.btn-facebook
.btn-whatsapp
.btn-pinterest
.btn-linkedin
.btn-reddit
.btn-tumblr
.btn-buffer
.btn-mix
.btn-vk
.btn-mail
.btn-print
Andrew Vadivelu
says:For WhatsApp share button to work
Edit the main.php file and replace as shown below:
// $whatsappURL = ‘whatsapp://send?text=’.$bs_subject.’ ‘.$bs_title . ‘ ‘ . $bs_url;
$whatsappURL = ‘https://api.whatsapp.com/send?text=’.$bs_subject.’ ‘.$bs_title . ‘ ‘ . $bs_url;
Basti
says:Hi Andrew,
what’s wrong? In my case WhatsApp (both desktop and mobile) works fine. Which OS are you using?
Lo Rednib
says:Hi Basti,
With your “bS5 Share Buttons” I’ve got this on my page:
Warning: Uninitialized string offset 0 in /Users/rednib/Sites/www/mysite/wp-content/plugins/bs5-share-buttons/main.php on line 69.
No trouble for me I just comment // this 69 line.
But I was wondering why, could you explain it to me ?
Basti
says:Hi Lo,
first time I see this. So, I cannot explain what there is right now. Do you use debug mode in WP?
Lo Rednib
says:Not yet !
It’s my first time with WP so I will check how work the debug mode.
Basti
says:You can enable debug mode in wp-config.php. Debug mode shows hidden tiny bugs in frontend when enabled. But plugin shows no errors in debug mode in my case. So, when your debug mode is disabled, where do you see this warning? A link to your site will be usefull for help 😉
Lo Rednib
says:Thanks for your answer.
My debug mode was set to false.
I see the error when I put the shortcode :
[bs-share-buttons]
I show the Warning: Uninitialized string offset 0 in /Users/rednib/Sites/www/mysite/wp-content/plugins/bs5-share-buttons/main.php on line 69
It is between the header and the content
My website is still on localhost