Support » Fixing WordPress » Customize feed by marking certain categories

  • I am using the mini-post plugin which allows me to have asides. One of the plugin options allows me to filter the asides out of my feed which I currently have set. But, I would rather not do that but instead mark any asides in my feed with some kind of indicator that it is an aside.

    For example, all my asides are in the “Extra! Extra!” category. I was thinking of editing the wp_rss2.php (and others) w/ some kind of PHP else argument such as (in a total non-PHP explanation):

    if category = extra! extra! then the title should be: [EXTRA! EXTRA!] Post Title

    Else

    Post Title

    I hope that makes sense, any ideas or is this even possible?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Editing the script file (wp-rss2.php that is) would be the quickest method. All you’d need do is change the following line in it:

    <title><?php the_title_rss() ?></title>

    to

    <title><?php if(in_category(1)) { echo "[EXTRA! EXTRA!] "; } the_title_rss(); ?></title>

    Just change the in_category() argument (1) to the numeric ID for your “Extra! Extra!” category.

    Thanks Kafka, I’ll try that out. What about for the other feeds? i.e. wp-rss, wp-rdf, wp-atom

    It’ll be the same for each feed script, but look out for the CDATA encapsulation for Atom:

    <title type="text/html" mode="escaped"><![CDATA[<?php the_title_rss() ?>]]></title>

    Just focus on the_title_rss tag.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customize feed by marking certain categories’ is closed to new replies.