Forums

RSS: show category name inside the title (1 post)

  1. pixeline
    Member
    Posted 2 years ago #

    Hi,

    I would like that my rss feed show the category name inside the title, like this:

    "This is the Title [ category 1, category 2 ]"

    Inside feed-rss2.php, I tried several things:

    1/ `<title><?php the_title_rss() ?> [ <?php
    foreach((get_the_category()) as $category) {

    echo $category->cat_name . ' ';
    }
    ?> ]</title>`

    2/
    <title><?php the_title_rss() ?> [ <?php the_category_rss() ?> ]</title>

    But none shows up correctly. If i look at the xml, it shows an xml "category" node with all the categories.

    What am i doing wrong?

Topic Closed

This topic has been closed to new replies.

About this Topic