Quantcast
Channel: Possible to use conditionals within add_feed() callback? - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 2

Possible to use conditionals within add_feed() callback?

$
0
0

I'm using add_feed() to create some custom feeds but calls to is_singular(), is_home() etc... just don't seem to work within the callback. Is there a workaround for this?

Example code:

add_action( 'init', 'my_init' );function my_init() {        add_feed( 'new_feed', 'feed_output' );}function feed_output() {    if ( is_home() )        load_template( '/path/to/feed/home/template.php' );    else        load_template( '/path/to/feed/template.php' );}

I've added a trac ticket for this too.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>