• I want to update the link to the RSS feed on each page depending on what the current category is. Is there a way to either:

    1) Call that directly?

    2) get the current category name with the dashes already in place? (category “foo bar” has the uri “foo-bar”)

    Either of these options would get me what I need.

    Mike.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Mike,

    If you have permalinks enabled, and are using the default stucture..then categories will have the URL of:

    http://yoursite.com/archives/category/<category name>

    If you add “/feed” to that URL, you will grab the RSS feed for that particular category.

    So, on whatever page you want to put the feel, just grab the SERVER_URL or something using PHP and then append “/feed” to it..

    It should be that simple. (TM) πŸ™‚

    Regards

    Thread Starter altp

    (@altp)

    This doesn’t seem to work. Most likely because by the time the PHP scripts get a whole of it, apache has already parsed it all out.

    No matter where I am on the site, request_uri is always the initial index.php … not the actual url that was visited.

    Thread Starter altp

    (@altp)

    Er. perhaps I should have actually ed used request_uri before responding ;-).

    works fine using that. I initially put it php_self for some reason

    Ahh yes..request_uri, that’s the one I was trying to think of. I’m glad it worked for you. πŸ™‚

    Regards

    thepete

    (@thepete)

    Thanks for this thread! It’s been very helpful.

    However, I have one question for Cypher (or anyone else who knows the answer): Is there anyway to have the category description and name used in the feed as opposed to the title of your blog and blog description?

    soupenvy

    (@soupenvy)

    And if you’re not using the default permalink stucture?

    – Can’t seem to get a category feed with the above methods.

    http://yoursite.com/archives/category/<category name>
    If you add “/feed” to that URL, you will grab the RSS feed for that particular category.

    This works as long as a category contains 1 page. With more pages, the mod_rewritten URL for a feed looks like http://site.com/category-name/page/4/feed/. There’s no feed at this address – only at http://site.com/category-name/feed/.

    How can I get the feed links on the deeper category pages to point to the …/category-name/feed/, not the unexisting …/category-name/page/number/feed/?

    This works as long as a category contains 1 page. With more pages, the mod_rewritten URL for a feed looks like site.com/category-name/page/4/feed/. There’s no feed at this address – only at site.com/category-name/feed/.

    How can I get the feed links on the deeper category pages to point to the …/category-name/feed/, not the unexisting …/category-name/page/number/feed/?

    I don’t suppose anyone has figured this out yet?

    I don’t suppose anyone has figured this out yet?

    I finally did myself! Added this to .htaccess

    RedirectMatch /categories/(.*)/page/.*/feed/ /categories/$1/feed/

    I had to use RedirectMatch, for some reason a similar RewriteRule was not working.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Current Category Feed’ is closed to new replies.