Forums

[resolved] Separate RSS Feeds by category or topic (5 posts)

  1. gmgartner
    Member
    Posted 5 years ago #

    I want to be able to separate my feeds by content but have not been able to find a plugin to do this. Any advice in this regard is appreciated.

  2. moshu
    Member
    Posted 5 years ago #

    No need for plugin.
    WP creates the category feeds out of the box.
    example.com/category/mycategory/feed - if using permalinks;
    otherwise they are at:
    example.com/?cat=1&feed=rss2

  3. gmgartner
    Member
    Posted 5 years ago #

    Thanks much. I was using example.com/feed/category/mycategory. That explains it.

  4. gmgartner
    Member
    Posted 5 years ago #

    Now that I have that straightened out, how do I call the category slug? get_the_category only seems to let me get id, title, and description. I'm using

    foreach((get_the_category()) as $cat) {
    echo $cat->cat_name . ' ';
    }

    as I am constructing a feed link on each category page. My loop doesn't give me the slug though.

  5. gmgartner
    Member
    Posted 5 years ago #

    Since the table column in wp-categories is category_nicename,

    foreach((get_the_category()) as $cat) {
    echo $cat->category_nicename . '/feed';
    }

    gets the job done. I see that I can call table data by column name. Safe to assume other functions work by the same logic. I'll see.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags