Below, you’ll find a detailed guide on how to add the RSS Antenna 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 RSS Antenna Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the RSS Antenna Plugin and the shortcodes it provides:
"RSS Antenna is a user-friendly WordPress plugin. It allows users to fetch, curate, and display live RSS feeds on their website, ensuring fresh content regularly."
- [rss_antenna]
RSS Antenna [rss_antenna] Shortcode
The RSS-Antenna plugin shortcode is designed to display an RSS feed on your website. This shortcode initiates the ‘show_rss_antenna’ function which captures and returns the output of the RSS feed. It uses output buffering to store the feed data and then clears the buffer.
Shortcode: [rss_antenna]
Examples and Usage
Basic example – A basic use of the shortcode for the RSS Antenna plugin. It does not require any parameters to work. It will display the default RSS feed configured in the plugin settings.
[rss-antenna /]
Advanced examples
Here, we are using the shortcode to display a specific RSS feed by passing the URL as a parameter. In this case, the feed from ‘https://example.com/rss’ will be displayed.
[rss-antenna url='https://example.com/rss' /]
In this example, we are using the shortcode to display a specific RSS feed and limit the number of items displayed. The ‘limit’ parameter restricts the feed to display only the first 5 items.
[rss-antenna url='https://example.com/rss' limit=5 /]
This example showcases the use of the shortcode to display a specific RSS feed, limit the number of items, and specify the date format. The ‘date_format’ parameter allows customization of how the date of each feed item is displayed.
[rss-antenna url='https://example.com/rss' limit=5 date_format='F j, Y' /]
PHP Function Code
In case you have difficulties debugging what causing issues with [rss_antenna]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode(self::SHORTCODE, array(&$this,'show_shortcode'));
Shortcode PHP function:
function show_shortcode(){
ob_start();
$this->show_rss_antenna();
$contents = ob_get_contents();
ob_end_clean();
return $contents;
}
Code file location:
rss-antenna/rss-antenna/rss-antenna.php
Conclusion
Now that you’ve learned how to embed the RSS Antenna 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