The MU forums have moved to WordPress.org

Rename RSS feed title independent of Blog title? (6 posts)

  1. gojsse
    Member
    Posted 16 years ago #

    I have a wpmu install setup so each blog is a separate section of a museum website. Did this so editing each section could have different users doing updates.

    http://plainsart.org/weblog/

    Now I want to rename the main RSS feed of each section to be a bit more unique for viewing feeds off-site.

    Example:
    There is a blog/section on the site called Exhibitions and in the feed I want it to say Plains Art Museum - Exhibitions so in the rss reader people will know it's for the museum.

  2. tdjcbe
    Member
    Posted 16 years ago #

    The answer is: It depends.

    Assuming that "Plains Art Museum" is the name of your wpmu install and "Exhibitions" is the name of your individual blog, I would just open up the files within /wp-includes/ like feed-rss.php, look for the title tags and add in

    For example:

    http://trac.mu.wordpress.org/browser/trunk/wp-includes/feed-rss.php

    <title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>

    Try editing that to become:

    <title><?php get_site_option('site_name'); bloginfo_rss('name'); wp_title_rss(); ?></title>

    Haven't tried it. Your mileage may vary.

  3. tdjcbe
    Member
    Posted 16 years ago #

    Oh and to finish on that, if those two assumption about the names are not correct, you'll need to tell us where that information is going to be coming from for us to work out a solution. I see on your example that the name of the blog is "Blog" so I have a feeling we may not be looking at the same thing.

  4. DeannaS
    Member
    Posted 16 years ago #

    Ack - don't hack core.

    There's a filter you can use - it's called 'get_wp_title_rss'.

    So, you'll need to write a plugin that creates what you want the title for the RSS feeds to be - probably some combo of site name and blog name, right? And, then utilize the filter.

    Something like so:

    <?php
    /*
    Plugin Name: Change the RSS title
    */
    function change_rss_title( )
    {
    $newtitle = get_site_option('site_name') . ' - ' . get_option('blogname');
    return $newtitle;
    }
    add_filter('get_wp_title_rss', 'change_rss_title');
    
    ?>

    Warning - untested code - written off the cuff.

  5. gojsse
    Member
    Posted 16 years ago #

    Thanks DeannaS - your code worked for the most part.

    Here's an example of what the add_filter code you gave me did:
    original rss feed: Exhibitions
    new rss feed after function added: Exhibitions Plains Art Museum - Exhibitions.

    Because I'm not too sure why it's not replacing the entire RSS title I settled for just

    function change_rss_title( )
    {
    $newtitle = ' - ' . get_site_option('site_name');
    return $newtitle;
    }
    add_filter('get_wp_title_rss', 'change_rss_title');

    Which made the rss title:
    Exhibitions - Plains Art Museum

    I am happy with that.

  6. DeannaS
    Member
    Posted 16 years ago #

    Great. I'm glad it worked for you with some tweaking.

About this Topic