I have client require to show a particular of Categories only after login only..
I have got below code which is working for Post Id, but i need it for full categories..
Below is code :
function my_force_login() {
global $post;
if (!is_single()) return;
$ids = array(188, 185, 171); // array of post IDs that force login to read
if (in_array((int)$post->ID, $ids) && !is_user_logged_in()) {
auth_redirect();
}
}
How can i modified above code to work in for Category…
I found a way from the code itself…