functions – Access category within rss2_head hook?

Question

Can I access the current category of a category feed with the rss2_head hook to add for example itunes tags?

Lets say I have wordpress.com/catx/feed I want to get acf field elements associated with this specific category.

Here is what I am trying to accomplish:

function itunes_head() {
        $category = get_the_category();
        $categories = get_category();
        global $post;
        var_dump($categories);
        echo print_r($post);
        echo $categories;
        echo $category;
}
add_filter( 'rss2_head', 'itunes_head' );

I am assuming that I somehow can retrieve the catx category here?

0
mahatmanich 3 months 2021-05-13T04:43:49-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse