Otto,
This is how I have been using feeds prior to 2.5:
in wp-feed.php
<?php
if (empty($doing_rss)) {
$doing_rss = 1;
require(dirname(__FILE__) . '/wp-blog-header.php');
}
// Remove the pad, if present.
$feed = preg_replace('/^_+/', '', $feed);
if ($feed == '' || $feed == 'feed') {
$feed = 'rss2';
}
if ( is_single() || ($withcomments == 1) ) {
require(ABSPATH . 'wp-commentsrss2.php');
} else {
switch ($feed) {
case 'atom':
require(ABSPATH . 'wp-atom.php');
break;
case 'rdf':
require(ABSPATH . 'wp-rdf.php');
break;
case 'rss':
require(ABSPATH . 'wp-rss.php');
break;
case 'rss2':
require(ABSPATH . 'wp-rss2.php');
break;
case 'comments-rss2':
require(ABSPATH . 'wp-commentsrss2.php');
break;
case 'overview':
require(ABSPATH . 'ssn-overview.php');
break;
case 'audience':
require(ABSPATH . 'ssn-audience.php');
break;
case 'screens':
require(ABSPATH . 'ssn-screens.php');
break;
case 'creative':
require(ABSPATH . 'ssn-creative.php');
break;
case 'lp_overview';
require(ABSPATH . 'ssn-lp-overview.php');
break;
case 'lp_ditl';
require(ABSPATH . 'ssn-lp-ditl.php');
break;
case 'lp_activities';
require(ABSPATH . 'ssn-lp-activities.php');
break;
case 'lp_research';
require(ABSPATH . 'ssn-lp-research.php');
break;
case 'shortDesc';
require(ABSPATH . 'ssn-shortDesc.php');
break;
case 'eh_overview';
require(ABSPATH . 'ssn-eh-overview.php');
break;
case 'vc_overview';
require(ABSPATH . 'ssn-vc-overview.php');
break;
case 'lph_overview';
require(ABSPATH . 'ssn-lph-overview.php');
break;
case 'lp_relatedVenues';
require(ABSPATH . 'ssn-lp-relatedVenues.php');
break;
}
}
?>
I am not versed in creating a plugin. I have looked at the codex and at some example plugins, but just ‘dont get it’ yet.
Here is what I am doing in 2.5 (functions.php):
function do_feed() {
global $wp_query;
$feed = get_query_var( 'feed' );
// Remove the pad, if present.
$feed = preg_replace( '/^_+/', '', $feed );
if ( $feed == '' || $feed == 'feed' )
$feed = get_default_feed();
$hook = 'do_feed_' . $feed;
if ( !has_action($hook) ) {
$message = sprintf( __( 'ERROR: %s is not a valid feed template' ), wp_specialchars($feed));
wp_die($message);
}
do_action( $hook, $wp_query->is_comment_feed );
}
/* Begin SSN Feeds */
function do_feed_audience() {
load_template( ABSPATH . WPINC . '/ssn-audience.php' );
}
/* End SSN Feeds */
What I understand is that the url parameter is passed as a variable to the function call. so do_feed_audience should be called if the requested url is https://www.url.com/postOrPage/?feed=audience.
What returns is “ERROR: audience is not a valid feed template”
when I do this:
$hook = 'do_feed_' . $feed;
if ( !has_action($hook) ) {
do_feed_audience();
}
The feed is displayed correctly.
Thoughts??