views:

98

answers:

1

I have it currently so that my post title links to an external URL using the following code in my index.php file.

<h1><a href="<?php echo get_post_meta($post->ID, 'external-link', true); ?>"><?php the_title(); ?></a> <a href="<?php the_permalink() ?>"><small>★</small></a></</h1>

I'd like to have the title of my RSS feed to do the same.

I'm using the FeedBurner FeedSmith plugin (Ver. 2.3.1) if that makes any difference.

A: 

Oooo! Unfortunately you have to start editing some of wordpress' files.

In wp_includes there are several files that have a prefix of feed, they are basically just 'feed templates', and in there you'll find the loop. then all you have to do is just replace:

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

with

<title><?php echo get_post_meta($post->ID, 'external-link', true); ?></title>

for each one, there are some with an ending of -comments, these are for any comments attached to your posts, can choose whether to bother doing these or not, i was extremely lazy and only bothered to edit rss2 hehe.

Anyway, the really annoying bit about this is you wont be able to update your wordpress without these files being overwritten, to overcome that simply duplicate a copy into your theme folder and add this into your functions.php file

//Alter default RSS feed
function disable_our_feeds() {
ob_start();
require_once(ABSPATH. 'wp-content/themes/yourtheme/feed-rss2.php');
$rss2 = ob_get_clean();
die($rss2);
}
add_action('do_feed_rss2', 'disable_our_feeds', 1);

And must add a function for eachand every one of the feeds, annoying eh?

I hope that helps :)

Rob
once I've moved the files and added that code to my functions.php file how do I know it's all working correctly?
cust0s
best way for me, is add some text to your titles, like i append '- this is custom', that way you know your template file is working correctly. Any problems let me know :)
Rob