Category Specific RSS feed Subscription Shortcodes

Below, you’ll find a detailed guide on how to add the Category Specific RSS feed Subscription Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Category Specific RSS feed Subscription Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Category Specific RSS feed Subscription Plugin and the shortcodes it provides:

Plugin Icon
Category Specific RSS feed Subscription

"Category Specific RSS feed Subscription is a versatile WordPress plugin. This tool allows users to create menu of RSS feeds for specific blog categories, enhancing content organization."

★★★★✩ (27) Active Installs: 5000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [category_specific_rss_menu]
  • [tag_specific_rss_menu]
  • [tag_specific_rss_cloud]
  • [post_specific_tag_rss]

Category Specific RSS feed Subscription [category_specific_rss_menu] Shortcode

The Category Specific RSS Feed Menu shortcode is a tool for displaying RSS feeds from specific categories. This shortcode, when added to a page or post, calls the ‘wp_category_specific_rss_handler’ function. This function, in turn, triggers the ‘show_rss_menu’ function with any attributes passed to it. The result is a tailored RSS feed menu based on the specified category.

Shortcode: [category_specific_rss_menu]

Examples and Usage

Basic example – The basic usage of the ‘category_specific_rss_menu’ shortcode involves simply calling it without any parameters. This will return the default RSS menu for your website’s categories.

[category_specific_rss_menu /]

Advanced examples

Displaying a specific category’s RSS feed by referencing the category ID. This will return the RSS menu for the specified category only.

[category_specific_rss_menu id=3 /]

Displaying multiple categories’ RSS feeds by referencing their IDs. This will return the RSS menus for the specified categories only.

[category_specific_rss_menu id="3,5,7" /]

Displaying a specific category’s RSS feed by referencing the category slug. This will return the RSS menu for the specified category only.

[category_specific_rss_menu slug="category-slug" /]

Displaying multiple categories’ RSS feeds by referencing their slugs. This will return the RSS menus for the specified categories only.

[category_specific_rss_menu slug="category-slug1,category-slug2" /]

Please note that the ‘id’ and ‘slug’ parameters cannot be used together in the same shortcode.

PHP Function Code

In case you have difficulties debugging what causing issues with [category_specific_rss_menu] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('category_specific_rss_menu', 'wp_category_specific_rss_handler');

Shortcode PHP function:

function wp_category_specific_rss_handler($atts) {
    return show_rss_menu($atts);
}

Code file location:

category-specific-rss-feed-menu/category-specific-rss-feed-menu/category-specific-rss-wp.php

Category Specific RSS feed Subscription [tag_specific_rss_menu] Shortcode

The ‘tag_specific_rss_menu’ shortcode is a feature of the Category Specific RSS Feed Menu plugin. It generates a list of all tags with an RSS feed link and tag link for each.

Shortcode: [tag_specific_rss_menu]

Examples and Usage

Basic example – The shortcode ‘tag_specific_rss_menu’ is used to display a list of all tags in your WordPress site with an RSS feed link for each tag.

[tag_specific_rss_menu /]

Advanced examples

Unfortunately, the shortcode ‘tag_specific_rss_menu’ does not accept any parameters. Therefore, there are no advanced usage examples with additional parameters. This shortcode is designed to be simple and straightforward, displaying a list of all tags with their corresponding RSS feed links without any customization options.

However, if you want to customize the output of this shortcode, you would have to modify the PHP function ‘wp_tag_specific_rss_handler’ in the plugin’s code. This would require a good understanding of PHP and WordPress development practices.

PHP Function Code

In case you have difficulties debugging what causing issues with [tag_specific_rss_menu] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('tag_specific_rss_menu', 'wp_tag_specific_rss_handler');

Shortcode PHP function:

function wp_tag_specific_rss_handler($args)
{
    $rss_image = CAT_SPEC_RSS_URL.'/rss_small_icon.png';
    $tags = get_tags();
    $html = '<div class="tag_specific_rss">';
    $html .= '<ul>';
    foreach ($tags as $tag) {
        $html .= '<li>';
        $tag_link = get_tag_link($tag->term_id);

        $html .= '<a title="Subscribe to the '.$tag->name.' feed" href="'.$tag_link.'/feed/"><img src="'.$rss_image.'" alt="tag feed" /></a>';//Tag feed link
        $html .= ' <a href="'.$tag_link.'">'.$tag->name.'</a>';//Tag link

        $html .= '</li>';
    }
    $html .= '</ul>';
    $html .= '</div>';
    return $html;
}

Code file location:

category-specific-rss-feed-menu/category-specific-rss-feed-menu/category-specific-rss-wp.php

Category Specific RSS feed Subscription [tag_specific_rss_cloud] Shortcode

The ‘tag_specific_rss_cloud’ shortcode from the Category Specific RSS Feed Menu plugin generates a tag cloud. Each tag in the cloud links to the RSS feed of posts with that specific tag.

Shortcode: [tag_specific_rss_cloud]

Examples and Usage

Basic example – A simple usage of the ‘tag_specific_rss_cloud’ shortcode without any parameters. It will display all the tags in your WordPress site as a cloud, where each tag is linked to its specific RSS feed.

[tag_specific_rss_cloud /]

PHP Function Code

In case you have difficulties debugging what causing issues with [tag_specific_rss_cloud] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('tag_specific_rss_cloud', 'wp_tag_specific_rss_cloud_handler');

Shortcode PHP function:

function wp_tag_specific_rss_cloud_handler($args)
{
    $rss_image = CAT_SPEC_RSS_URL.'/rss_small_icon.png';
    $tags = get_tags();
    $html = '<div class="tag_specific_rss_cloud">';

    foreach ($tags as $tag) {
	$tag_link = get_tag_link( $tag->term_id );
	$tag_feed_link = $tag_link.'feed/';	
	$html .= "<a href='{$tag_feed_link}' title='{$tag->name} Tag' class='{$tag->slug} tag_cloud_rss_item'>{$tag->name}</a> ";
    }
    $html .= '</div>';
    return $html;
}

Code file location:

category-specific-rss-feed-menu/category-specific-rss-feed-menu/category-specific-rss-wp.php

Category Specific RSS feed Subscription [post_specific_tag_rss] Shortcode

The Category Specific RSS Feed Menu plugin shortcode, ‘post_specific_tag_rss’, generates an RSS feed for specific post tags. The shortcode fetches the post’s tags and creates a list with each tag having a link to its RSS feed. It also includes an RSS icon for each tag.

Shortcode: [post_specific_tag_rss]

Parameters

Here is a list of all possible post_specific_tag_rss shortcode parameters and attributes:

  • post_id – The unique identifier of the specific post

Examples and Usage

Basic Example – The shortcode is used to display the RSS feed for tags related to a specific post. By default, it will use the ID of the current post.

[post_specific_tag_rss /]

Advanced Examples

For more control, you can specify the post ID. This will display the RSS feed for tags related to the post with the given ID.

[post_specific_tag_rss post_id=123 /]

You can also combine multiple parameters. This example shows how to display the RSS feed for tags of two different posts. Replace ‘123’ and ‘456’ with your own post IDs.

[post_specific_tag_rss post_id=123 /]
[post_specific_tag_rss post_id=456 /]

PHP Function Code

In case you have difficulties debugging what causing issues with [post_specific_tag_rss] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('post_specific_tag_rss', 'post_specific_tag_rss_handler');

Shortcode PHP function:

function post_specific_tag_rss_handler($args=array())
{
    if(isset($args['post_id'])){
        $post_id = $args['post_id'];
    }else{
        global $post;
        $post_id = $post->ID;
    }
    
    $rss_image = CAT_SPEC_RSS_URL.'/rss_small_icon.png';
    
    $tags = wp_get_post_tags($post_id);
    $html = '<div class="post_specific_tag_rss">';
    $html .= '<ul>';
    foreach ($tags as $tag) {
        $html .= '<li>';
        $tag_link = get_tag_link($tag->term_id);

        $html .= '<a title="Subscribe to the '.$tag->name.' feed" href="'.$tag_link.'/feed/"><img src="'.$rss_image.'" alt="tag feed" /></a>';//Tag feed link
        $html .= ' <a href="'.$tag_link.'">'.$tag->name.'</a>';//Tag link

        $html .= '</li>';
    }
    $html .= '</ul>';
    $html .= '</div>';
    return $html;
}

Code file location:

category-specific-rss-feed-menu/category-specific-rss-feed-menu/category-specific-rss-wp.php

Conclusion

Now that you’ve learned how to embed the Category Specific RSS feed Subscription Plugin shortcodes, 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.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *