Below, you’ll find a detailed guide on how to add the Simple Like Page 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 Simple Like Page Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Simple Like Page Plugin and the shortcodes it provides:
"Simple Like Page Plugin is a user-friendly WordPress tool that lets you effortlessly integrate Facebook functions into your website. Boost your social media presence with this easy-to-use plugin."
- [sfp-page-plugin]
Simple Like Page [sfp-page-plugin] Shortcode
The Simple Facebook Plugin shortcode ‘sfp-page-plugin’ allows users to customize and embed a Facebook page plugin on their website. It provides options to select the URL, adjust dimensions, and toggle visibility of various elements.
Shortcode: [sfp-page-plugin]
Parameters
Here is a list of all possible sfp-page-plugin shortcode parameters and attributes:
url
– The web address of the Facebook page you want to display.width
– The width of the Facebook Page plugin on your site.height
– The height of the Facebook Page plugin on your site.hide_cover
– If set to true, it hides the cover photo of the Facebook page.show_facepile
– If set to true, it displays the profile photos of people who like the page.small_header
– If set to true, it uses a smaller version of the page header.timeline
– If set to true, it displays the posts from the Facebook page’s timeline.events
– If set to true, it displays the upcoming events of the Facebook page.messages
– If set to true, it allows people to send messages to the Facebook page from your site.locale
– Sets the language of the Facebook page plugin.
Examples and Usage
Basic example – Display a Facebook page plugin with default options.
[sfp-page-plugin /]
Advanced examples
Display a Facebook page plugin with a specific URL and width.
[sfp-page-plugin url="http://www.facebook.com/your_page_name" width="500" /]
Display a Facebook page plugin with a specific URL, width, height, and hide the cover photo.
[sfp-page-plugin url="http://www.facebook.com/your_page_name" width="500" height="800" hide_cover="true" /]
Display a Facebook page plugin with a specific URL, width, height, hide the cover photo, and show the facepile.
[sfp-page-plugin url="http://www.facebook.com/your_page_name" width="500" height="800" hide_cover="true" show_facepile="true" /]
Display a Facebook page plugin with a specific URL, width, height, hide the cover photo, show the facepile, and use a small header.
[sfp-page-plugin url="http://www.facebook.com/your_page_name" width="500" height="800" hide_cover="true" show_facepile="true" small_header="true" /]
Display a Facebook page plugin with all available options.
[sfp-page-plugin url="http://www.facebook.com/your_page_name" width="500" height="800" hide_cover="true" show_facepile="true" small_header="true" timeline="true" events="true" messages="true" locale="en_US" /]
PHP Function Code
In case you have difficulties debugging what causing issues with [sfp-page-plugin]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('sfp-page-plugin', 'sfp_page_plugin_shortcode');
Shortcode PHP function:
function sfp_page_plugin_shortcode ( $instance ) {
global $sfplugin;
$instance = ( !$instance ) ? array() : $instance;
// Add-ons hook
$instance = apply_filters( "sfp_before_page_plugin", $instance, $sfplugin );
extract( array_merge( array(
// default options
'url' => 'http://www.facebook.com/topdevs.net',
'width' => '',
'height' => '',
'hide_cover' => false,
'show_facepile' => true,
'small_header' => false,
'timeline' => false,
'events' => false,
'messages' => false,
'locale' => 'en_US'
), $instance ) );
ob_start();
// include Page Plugin view
include( $sfplugin->pluginPath . 'views/view-page-plugin.php' );
return ob_get_clean();
}
Code file location:
simple-facebook-plugin/simple-facebook-plugin/simple-facebook-plugin.php
Conclusion
Now that you’ve learned how to embed the Simple Like Page 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