Below, you’ll find a detailed guide on how to add the 10Web Social Post Feed 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 10Web Social Post Feed Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the 10Web Social Post Feed Plugin and the shortcodes it provides:
"10Web Social Post Feed is a dynamic WordPress plugin that seamlessly integrates your Facebook feed into your website. With its user-friendly interface, boost your site's social engagement effortlessly."
- [WD_FB]
10Web Social Post Feed [WD_FB] Shortcode
The WD_FB shortcode is used to display a specific Facebook feed on your website. It fetches the feed data from the database using the given ID in the shortcode. If the feed doesn’t exist, it throws an error message. It then buffers the output and returns it as a string, removing any line breaks for smooth display.
Shortcode: [WD_FB]
Parameters
Here is a list of all possible WD_FB shortcode parameters and attributes:
id
– Represents the unique identifier of the Facebook feedfb_id
– Duplicates the ‘id’ to associate with the Facebook feed
Examples and Usage
Basic example – Showcases a simple usage of the WD_FB shortcode to display a Facebook feed by referencing its ID.
[WD_FB id=1 /]
PHP Function Code
In case you have difficulties debugging what causing issues with [WD_FB]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('WD_FB', 'ffwd_shortcode');
Shortcode PHP function:
function ffwd_shortcode($params) {
global $wpdb;
require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
$check_fb_feed = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "wd_fb_info WHERE id='%d'", $params['id']));
require_once(WD_FFWD_DIR . '/framework/WDFacebookFeed.php');
if ( !$check_fb_feed ) {
echo WDW_FFWD_Library::message(__('Feed Doesn\'t exists', 'bwg'), 'error');
return;
}
$params['fb_id'] = $params['id'];
ob_start();
ffwd_front_end($params);
return str_replace(array("\r\n", "\n", "\r"), '', ob_get_clean());
}
Code file location:
wd-facebook-feed/wd-facebook-feed/facebook-feed-wd.php
Conclusion
Now that you’ve learned how to embed the 10Web Social Post Feed 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