Archive Page(s) & Redirect Issue
-
At this site, I am using below in functions.php of 2011 Child Theme to redirect non logged in users to the home page when they attempt to access the category (which works initially as intended):
add_action('template_redirect','cat_redirect');function cat_redirect(){ if ((in_category('memories')) && !is_user_logged_in() ) { wp_redirect( 'https://swansonheritage.com/' ); die(); }}
What I just noted is that if an archive page includes a post in that category, it will also re-direct to the home page…for example here
Any ideas on a best solution?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Archive Page(s) & Redirect Issue’ is closed to new replies.