Can you share the code you tried?
Also, have you tried using the home_url() function instead?
https://codex.wordpress.org/Function_Reference/home_url
Thanks Kevin. Here is my code. Working great on the listed pages, just not the main page. And yes, I’m using home URL already due to my temp domain:
http://4b9.ddd.myftpupload.com/
function my_forcelogin_whitelist( $whitelist ) {
$whitelist[] = home_url( ‘/current-member-districts/’ );
$whitelist[] = home_url( ‘/about/’ );
$whitelist[] = home_url( ‘/how-to-become-a-member/’ );
$whitelist[] = home_url( ‘/upcoming-bid-specifications/’ );
$whitelist[] = home_url( ‘/contact-us/’ );
$whitelist[] = home_url();
return $whitelist;
}
add_filter(‘v_forcelogin_whitelist’, ‘my_forcelogin_whitelist’, 10, 1);
Kevin – Thanks for the reply… works great on all 5 whitelist pages except front page. Yes, already using home_url() due to my temp domain.
http://4b9.ddd.myftpupload.com/
function my_forcelogin_whitelist( $whitelist ) {
$whitelist[] = home_url( '/current-member-districts/' );
$whitelist[] = home_url( '/about/' );
$whitelist[] = home_url( '/how-to-become-a-member/' );
$whitelist[] = home_url( '/upcoming-bid-specifications/' );
$whitelist[] = home_url( '/contact-us/' );
$whitelist[] = home_url();
return $whitelist;
}
add_filter('v_forcelogin_whitelist', 'my_forcelogin_whitelist', 10, 1);
@kdcargile:Your post were caught in the forum’s spam filter. As you see I’ve now released them (apart from the obvious duplicates – which I’ve deleted).
@kdcargile: Thanks for sharing your code – have you tried passing a forward slash to the home_url() function?
For example:
$whitelist[] = home_url('/');
Thanks Kevin – that seems to be it!
Thanks, this topic help me too.