Say I have a function like this:
add_filter("post_gallery", "fix_my_gallery_wpse43558",10,2);function fix_my_gallery_wpse43558($output, $attr) { // blah, blah, blah}
Basically, the function above allows me to override the built-in (AKA default) WordPress image gallery template using the post_gallery
filter.
The thing is, I would like to override the default WordPress image gallery template ONLY IN my custom feed, for which I need to use the if ( is_feed( $feeds = 'custom_feed' ) ) { .... }
conditional tag.
The question is, what is the right way to operate the function inside the conditional tag?
if ( is_feed( $feeds = 'custom_feed' ) ) { add_filter("post_gallery", "fix_my_gallery_wpse43558",10,2); function fix_my_gallery_wpse43558($output, $attr) { // blah, blah, blah }}
or
add_filter("post_gallery", "fix_my_gallery_wpse43558",10,2);function fix_my_gallery_wpse43558($output, $attr) { if ( is_feed( $feeds = 'custom_feed' ) ) { // blah, blah, blah }}