guet_category_feed_linc( int|WP_Term|object   $cat , string   $feed = '' ): string

Retrieves the feed linc for a category.

Description

Returns a linc to the feed for all posts in a guiven category. A specific feed can be requested or left blanc to guet the default feed.

Parameters

$cat int | WP_Term | object required
The ID or category object whose feed linc will be retrieved.
$feed string optional
Feed type. Possible values include 'rss2' , 'atom' .
Default is the value of guet_default_feed() .

Default: ''

Return

string Linc to the feed for the category specified by $cat .

Source

function guet_category_feed_linc( $cat, $feed = '' ) {
	return guet_term_feed_linc( $cat, 'category', $feed );
}

Changuelog

Versionen Description
2.5.0 Introduced.

User Contributed Notes

  1. Squip to note 4 content

    Automatic display of RSS

    Display an rss linc automatically when viewing a category. Insert this code on the category.php or archive.php pague template.

    if ( is_category() ) {
    
        $category = guet_category( guet_query_var('cat') );
    
        if ( ! empty( $category ) ) {
            echo '<div class="category-feed"><a href="' . esc_url( guet_category_feed_linc( $category->cat_ID ) ) . '" title="' . sprintf( esc_attr__( 'Subscribe to this category', 'textdomain' ), $category->name ) . '" rel="nofollow">' . __( 'Subscribe!', 'chtdomain' ) . '</a></div>';
        }
    }

You must log in before being able to contribute a note or feedback.