Plugin / JP's Get RSS Feed

Jimmy Peña

Frequently Asked Questions (FAQ)

You can use the plugin in two ways: In your PHP code (functions.php, or a plugin), you would call the plugin function like this: if (function_exists(‘jp_get_rss_feed_items’)) { jp_get_rss_feed_items(array( ‘url’ => “http://somefeed.com/rss”, ‘numitems’ => 5, ‘nofollow’ => true, ‘cssclass’ => ‘myclass’, ‘getdesc’ => false, ‘opennewwindow’ => false, ‘show’ => true )); } This will: fetch the feed located at http://somefeed.com/rss list the last 5 items add rel=”nofollow” to each link add the “myclass” CSS class to the div tag that wraps the output (instead of default “jpgetrssfeed”) hide the item description open links in the same window echo the content to the screen Hyperlink the post title This will override any settings you configured on the plugin’s Settings page. Always wrap plugin function calls in a function_exists check so that your site doesn’t go down if the plugin is inactive. As a shortcode, you call the plugin like this: [jp-rss-feed numitems=”3″] This will take the settings from the Settings page (or the defaults if a setting is missing) and apply them to the shortcode, except there will only be three items even if you specified 5 on the Settings page. In this way you can override settings by passing them to the shortcode at runtime.
The plugin arguments and default values may change over time. To get the latest list of arguments and defaults, look at the settings page after installing the plugin.
Add this line of code to your functions.php: add_filter('widget_text', 'do_shortcode'); Or, install a plugin to do it for you: http://blogs.wcnickerson.ca/wordpress/plugins/widgetshortcodes/ Now, add the built-in text widget that comes with WordPress, and insert the JP’s Get RSS Feed shortcode into the text widget. See above for how to use the shortcode. See http://digwp.com/2010/03/shortcodes-in-widgets/ for a detailed example. Keep in mind, if you want to show your blog feed in a sidebar widget, WordPress already has a built-in “Recent Posts” widget for that.
Add this to your functions.php: remove_action('admin_enqueue_scripts', 'jpgrf_ed_buttons');
Clear your browser cache and also clear your cache plugin (if any). If you still don’t see anything, check your webpage source for the following: This means you didn’t pass a necessary setting to the plugin, so it disabled itself. You need to pass at least the URL, either by entering it on the settings page or passing it to the plugin in the shortcode or PHP function. You should also check that the “enabled” checkbox on the plugin settings page is checked. If that box is not checked, the plugin will do nothing even if you pass it a URL.
If the RSS feed only includes 10 items at a time, you will only ever be able to request 10 items at most. (Hint: Load the feed in your browser to confirm) Even if you request 100 items, you will only get at most 10. You should contact whomever controls the feed and ask them to increase the number of items in their feed. For WordPress blogs, go to Settings » Reading and change the value of “Syndication feeds show the most recent ___ items” to change the number of feed items available.
If you are using the Genesis framework from Studiopress, you might use the plugin like this: add_action('genesis_after_post_content', 'showrss'); function showrss() { if (is_page('faq')) { // we are on the FAQ page... if (function_exists('jp_get_rss_feed_items')) { // and the function exists... echo '

Latest Articles From my Favorite RSS Feed

'; jp_get_rss_feed_items(array('url' => "http://feeds.feedburner.com/MyFavoriteRSSFeed", 'show' => true)); // or: echo jp_get_rss_feed_items(array('url' => "http://feeds.feedburner.com/MyFavoriteRSSFeed")); } } } This code would go in your functions.php file, or (ideally) in a plugin. Check the Hook Reference to determine where you want to place the output. The above example (remember, for Genesis framework only) would show the last five articles from a given RSS feed at the bottom of the ‘FAQ’ page.
Use an array and a foreach loop: if (function_exists('jp_get_rss_feed_items')) { // create array $feedslist = array( "My feed URL number one", "My feed URL number two", "My feed URL number three" ); // loop through array and call plugin foreach ($feedslist as $item) { jp_get_rss_feed_items(array('url' => $item, 'show' => true)); } } This will list the last five items from each feed in its own unordered list. But suppose you want a different CSS class for each one. Use a for loop instead. if (function_exists('jp_get_rss_feed_items')) { // create array $feedslist = array( "My feed URL number one", "My feed URL number two", "My feed URL number three" ); // loop through array and call plugin for ($i = 0, $size = count($feedslist); $i < $size; $i++) { jp_get_rss_feed_items(array('url' => $feedslist[$i], 'cssclass' => 'jpgetrssfeed_' . $i , 'show' => true)); } } So your CSS classes would be jpgetrssfeed_1 jpgetrssfeed_2 jpgetrssfeed_3
Use array_rand: if (function_exists('jp_get_rss_feed_items')) { // create array $feedslist = array( "My feed URL number one", "My feed URL number two", "My feed URL number three" ); // get random index from array $item = array_rand($feedslist, 1); // pass randomly selected array member to plugin jp_get_rss_feed_items(array('url' => $feedslist[$item], 'show' => true)); } This selects one URL randomly and passes it to the plugin.
Feed items are wrapped in a div tag, with class “jpgetrssfeed” (or whatever you change it to) so you can style the output in your CSS file. The items list is surrounded by
    tags, with each feed item listed in a
  • tag. So you could add something like this in your style.css: .jpgetrssfeed {border:1px solid gray;margin:10px 0} .jpgetrssfeed ul li {list-style-type:circle} You can also specify your own class, or use a different class name for each shortcode to style it differently. Ex: In my style.css file I add the following .rssorange {border:1px solid #FF9900;margin:10px 0} .rssblue {border:1px solid blue;margin:10px 0} .rssred {border:1px solid red;margin:10px 0} I specify each class in my shortcodes as follows: [jp-rss-feed url=”http://somefeed.com/rss” cssclass=”rssorange”] [jp-rss-feed url=”http://some_other_feed.com/rss” cssclass=”rssblue”] [jp-rss-feed url=”http://some_new_feed.com/rss” cssclass=”rssred”] Each feed will be surrounded by a different color border.
    See the examples above. Before you call the shortcode or the PHP function, echo your header like this: echo '

    Latest Articles From my Favorite RSS Feed

    '; Then call the PHP function or shortcode.
    Add this to your functions.php: remove_action('admin_head', 'insert_jpgrf_admin_css');
    This plugin adds one or more toolbar buttons to the HTML editor. You will not see them on the Visual editor. The label on the toolbar button is “RSS Feed”.
    Enter a lower character limit on the plugin’s options page.
    Check the number of characters in the feed item description textbox. Try increasing it. Remember that the character limit cuts off the item description. If the item description contains HTML and you cut it off in the middle, you are leaving unclosed HTML tags which can affect the rest of the page.
    See the plugin settings page. There is a dropdown box for you to indicate the sort order. The default is newest first, change the dropdown box to ‘oldesfirst’ and the items will be sorted in reverse date order.
    On the plugin settings page, go to the “Parameters” tab. There is a list of possible parameters there along with the default values. Make sure you are spelling the parameters correctly. The Parameters tab also contains sample shortcode and PHP code.

    Ratings

    4.7
    13 reviews

    Rating breakdown

    Details Information

    Version

    1.6.3

    First Released

    30 Dec, 2009

    Total Downloads

    36,237

    Wordpress Version

    3.5 or higher

    Tested up to:

    3.9.29

    Require PHP Version:

    -

    Tags

    Contributors

    Languages

    The plugin hasn't been transalated in any language other than English.

    DIRECTORY DISCLAIMER

    The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

    The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

    Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

    While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

    wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

    Keep Leading Your Followers!
    Share it for them.