Below, you’ll find a detailed guide on how to add the Social Share With Floating Bar Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Social Share With Floating Bar Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Social Share With Floating Bar Plugin and the shortcodes it provides:
"Social Share With Floating Bar is a WordPress plugin that enables easy social media sharing. It features a customizable, floating bar for seamless user experience. Enhance your site's engagement now."
- [sswfb_post_share]
Social Share With Floating Bar [sswfb_post_share] Shortcode
The Social Share With Floating Bar (SSWFB) shortcode is a custom function that enables the sharing of posts. This shortcode utilizes the ‘share_post_shortcode’ function, which allows users to specify the type of share button (‘text’ by default) via ‘share_type’ attribute. The function then builds and returns these share buttons accordingly.
Shortcode: [sswfb_post_share]
Parameters
Here is a list of all possible sswfb_post_share shortcode parameters and attributes:
share_type
– determines the type of share button to display
Examples and Usage
Basic example – A shortcode to share a post with a text type share button.
[sswfb_post_share share_type=text /]
Advanced examples
Using the shortcode to share a post with a different type of share button. If the specified share_type is not available, it will default to the text type.
[sswfb_post_share share_type=image /]
Using the shortcode without specifying the share_type attribute. In this case, it will default to the text type.
[sswfb_post_share /]
PHP Function Code
In case you have difficulties debugging what causing issues with [sswfb_post_share]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'sswfb_post_share', array($this, 'share_post_shortcode') );
Shortcode PHP function:
function share_post_shortcode( $atts, $content = null ) {
$options = shortcode_atts( array(
'share_type' => 'text'
), $atts );
$button_type = $options['share_type'];
return $this->build_share_buttons( $button_type );
}
Code file location:
social-share-with-floating-bar/social-share-with-floating-bar/social-share-with-floating-bar.php
Conclusion
Now that you’ve learned how to embed the Social Share With Floating Bar Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply