Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@greenhornet79
Last active September 28, 2022 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenhornet79/514a21de87a9d26d5c5b6935b684c126 to your computer and use it in GitHub Desktop.
Save greenhornet79/514a21de87a9d26d5c5b6935b684c126 to your computer and use it in GitHub Desktop.
<?php
add_action( 'template_redirect', 'zeen101_custom_redirects' );
function zeen101_custom_redirects() {
if ( !is_category() ) {
return;
}
$allowed_cat_ids = array( 4,9 );
if ( !is_category( $allowed_cat_ids ) && !leaky_paywall_user_has_access() ) {
wp_redirect( home_url( '/subscribe/' ) );
die;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment