Customize feed by marking certain categories (4 posts)

  1. mayurpatel
    Posted 10 years ago #

    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


    Post Title

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

  2. Kafkaesqui

    Posted 10 years ago #

    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>


    <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.

  3. mayurpatel
    Posted 10 years ago #

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

  4. Kafkaesqui

    Posted 10 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic