Support » Fixing WordPress » wp_list_cats Unable to Return Single Category RSS

  • Hi folks,
    I’ve pored through the wiki docs on wp_list_cats, and I’ve come to the conclusion that either:
    1) the wiki is wrong about passing parameters for the variable ‘categories’,
    2) the 1.3a5 implementation of wp_list_cats is broken,
    or
    3) I’m just deeply confused.
    I have tried multiple variations on sending a single category ID to wp_list_cats for the purpose of getting a link to the RSS which covers just a single category. (I’m doing this on a theme with an individual category page.) I’ve tried extracting that ID via the_category_ID as well as just manually putting in a single number for testing purposes. However, in every single case wp_list_cats just dumps out all categories, regardless of what is passed via the ‘categories’ parameter.
    Would anyone be able to point me in the right direction for either confirming 1) or 2) above or getting rid of 3) above by letting me know the exact syntax for a call to wp_list_cats that will return an RSS link for just one single category?
    Many thanks!
    Greg
    p.s. Forgot to say: yes, I have searched the forum already but none of the folks previously posting on closely related topics has ever received an answer which would allow just one single category RSS link to be returned by wp_list_cats.

Viewing 8 replies - 1 through 8 (of 8 total)
  • If you want an rss link to just a single category instead of all, why not just hard code one? I’m confused.

    Hi Beel,
    If you mean hard-coding part of the feed URL just by appending /feeds/etc. to the end of the URL for the category page, that would work…if only there were a straightforward way to extract the URL for the category presently being viewed..but unfortunately there doesn’t seem to be.
    If you mean hard-coding the whole entire feed URL, then this doesn’t work in the context of a theme using a category page, where that one page will be used to build what is delivered to the browser, regardless of what specific category we might be in.
    Does that make sense? Or did I misunderstand your question, and you were wondering about a different mix of hard-coding & soft-coding?
    Thanks,
    Greg

    I just tried using the category array in wp_list_cats and thus far I could not get it to work. I do have it display the RSS feed for each individual category, though.
    I haven’t had my coffee yet, I just don’t seem to be able to picture what you are trying to do. I’ll grab a cup of coffee and read more slowly…

    Hi Beel,
    Thanks for trying it out — the fact the array hasn’t worked for you yet reassures me I’m not *totally* confused, at least! 🙂
    What I’m trying to achieve, from the visitor’s point of view is: I see a category title I like in the sidebar, I click on that category title, and I’m taken to a page that lists all the recent posts in that category. But also on that page, just below the text describing what kinds of things appear in the category, is a handy little blurb saying that if I’d like to keep track of new posts just in this category, all I have to do is click here…
    Unfortunately, I can get it to say click here or here or here or here, depending on which category the user might like, but I cannot get it to say just click here for an RSS feed matching this category which you are viewing right this moment.
    Does that make sense?
    Thanks,
    Greg

    That should be easy to set up, but while I think about it, I get around it by displaying an RSS feed image and link next to each category in the list.

    Hi Beel,
    That sounds like a good suggestion — just circumvent the whole wp_list_cats query altogether! I’ll have to leave it a little while to try it out, as it’s dinner time now for me (past, actually), but I’ll put this into my theme as soon as I can!
    Thanks very much,
    Greg

    Hi Beel,
    (The next morning…)
    Your suggested workaround works exactly as expected — many thanks!
    Greg

    Using WordPress 1.5

    Would there be a way to get the title of the category into the RSS feed?

    For example, I have a blog called “MyBlog” and it has a category “Pies”. Is there a way to get the wp-rss2.php?cat=9 script to show “Pies” as the title in the RSS feed instead of “MyBlog”? The archive page shows that this is an archive of category “Pies”, but the rss feed generated by the category constrained script only shows the title “MyBlog”.

    Any pointers?

    Thanks in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.