Hey everyone,
I have a site that forces user registration when they browse away from certain pages. This is great for our security purposes, but is giving me issues when trying to run my feed through feedburner.
The link to my feed works fine:
http://www.ourbestassociates.com/feed/?post_type=corenews
However, when I try to insert that link at feedburner and get my feed going, the website redirects them to the registration page, which then in turn results in an error from Feedburner, telling me the page is a webpage, not a feed page.
No duh. So, here is the code which excludes certain pages, but is there a way to exclude the feed link as well?
if( !function_exists('forceRegistration') ) :
function forceRegistration() {
if( !is_user_logged_in() ) :
if( !is_page(12) && !is_page(14) && !is_page(115) && !is_page(40) && !is_page(139) ) :
header("HTTP/1.1 302 Temporary Redirect");
header("Location:" . get_permalink(115) );
exit();
endif;
endif;
}
add_action('template_redirect', 'forceRegistration');
endif;