Support » Networking WordPress » Customizing Multisite RSS Feed?

  • ChrisH

    (@chrish)


    I’m helping out with a new blog network, and I’m looking for a way to tweak our main RSS feed so that it’s a little clearer which posts are coming from who. One of the things that the network feed is used for is to automatically send out Tweets of posts via HootSuite, but the feed sends out only the title of each post (plus a summary or meta description). There’s about twenty blogs right now, so it would be nice if we could let people know who’s actually speaking with each post.

    So, I’m wondering if there’s a way to do it so that each title looks like:

    [Blog name]: [Post Title]

    Thanks!

Viewing 1 replies (of 1 total)
  • Each site’s outgoing RSS has built in hooks/filters.

    The usual template tags can be used to echo whatever you like in the outgoing feed title:

    I offer the following mu-plugin snippet:

    <?php
    add_filter('the_title_rss', 'ds_rss_post_title');
    
    function ds_rss_post_title($title) {
       $blogname = bloginfo( 'name' );
       $title = $blogname . ': ' . $title;
    	return $title ;
    }
    ?>

    That’ll get you [Blog name]: [Post Title] in each site’s own RSS feed.

    However, what plugin is used to generate your “main RSS feed”?
    I use Donncha’s MU Sitewide Tags Plugin to generate my network feed.
    So I offer for your consideration a plugin snippet I use only on the “Tags Blog”:

    <?php 
    
    add_filter('the_title_rss', 'ds_rss_post_title');
    
    function ds_rss_post_title($title) {
    global $post;
    
    list( $post_blog_id, $post_id ) = explode( '.', substr($post->guid, 7));
    //$blogname = bloginfo( 'name' );
    //$blogname = $post_blog_id . ': ' . $post_id;
    //$blogname = get_blog_permalink($post_blog_id,$post_id);
    
      $blog_details = get_blog_details($post_blog_id);
      $blogname = $blog_details->blogname;
    
    $title = $blogname . ': ' . $title;
    
    	return $title ;
    }
    ?>

    That gets me [Blog name]: [Post Title] in my Network RSS feed.

Viewing 1 replies (of 1 total)
  • The topic ‘Customizing Multisite RSS Feed?’ is closed to new replies.