• I setting up feeds for my site. I want to link to different feed depending on what type of page is being viewed. The code I’ve figure out is:


    <?php if ( is_home() ) { ?><link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> (RSS 2.0)" href="<?php bloginfo('rss2_url'); ?>" /><?php } ?>
    <?php if ( is_author() ) { ?><?php if(isset($_GET['author_name'])) :
    $curauth = get_userdatabylogin($_GET['author_name']);
    else :
    $curauth = get_userdata($_GET['author']);
    endif; ?><link rel="alternate" type="application/rss+xml" title="<?php echo $curauth->first_name; ?> <?php echo $curauth->last_name; ?> (RSS 2.0)" href="<?php bloginfo('url'); ?>/index.php?author=<?php echo $curauth->ID; ?>&feed=rss2" /><?php } ?>

    Sorry for the ugly code. I haven’t figured out how to get wordpress to return the ID number for the categories. Does anyone know how to do this? Is there maybe and easier way to do this?

    Also, is there anyway to edit the feeds so they realize that it’s a feed for an author or for a category?

  • The topic ‘RSS feeds for authors and categories’ is closed to new replies.