Excluding protected posts by WP-Members
-
Hi,
I`m using Relevanssi and WP-Members and want to excluding protected pages in my search results for not logged in users. The pages, protectes by WP-Members, should only include in search results for logged in users. Is this possible?I tried this Code from you, but it does not work:
`add_filter( ‘relevanssi_post_ok’, ‘rlv_search_exclude_protected’, 10, 2 );
function rlv_search_exclude_protected( $allow, $post_id ) {
$post = get_post( $post_id );
if ( ! empty( $post->post_password ) ) {
$allow = false;
if ( is_user_logged_in() ) {
$allow = true;
}
}
return $allow;
}Some idea to solve this problem? It would be glad!! And me too ??
Thanks a lot
RenegateThe page I need help with: [log in to see the link]
- The topic ‘Excluding protected posts by WP-Members’ is closed to new replies.