The feed_links_extra() WordPress PHP function displays links to the extra feeds, such as category feeds.
Usage
Here’s a generic example of how to use the function:
feed_links_extra(array('cat' => 1));
This will display links to the RSS feed of category with ID 1.
Parameters
- $args (array) – Optional. The array of arguments you want to pass. Default: array()
More information
See WordPress Developer Resources: feed_links_extra
The feed_links_extra() function was implemented in WordPress version 2.8.0.
Examples
Display Extra Feed Links for a Specific Category
In this example, we will display the extra feed links for a category with the ID of 3.
// Display extra feed links for Category ID 3 feed_links_extra(array('cat' => 3));
Display Extra Feed Links for Multiple Categories
Here, we display the extra feed links for categories with the IDs 2, 5, and 9.
// Display extra feed links for Category IDs 2, 5, and 9 feed_links_extra(array('cat' => array(2,5,9)));
Display Extra Feed Links Without Any Specific Category
In this case, we display the extra feed links without any specific category.
// Display extra feed links without any specific category feed_links_extra();
Display Extra Feed Links for a Specific Post
This example displays the extra feed links for a post with the ID of 7.
// Display extra feed links for Post ID 7 feed_links_extra(array('p' => 7));
Display Extra Feed Links for a Specific Page
Lastly, we display the extra feed links for a page with the ID of 10.
// Display extra feed links for Page ID 10 feed_links_extra(array('page_id' => 10));