Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Kevin Vess

    (@kevinvess)

    Can you share the code you tried?

    Also, have you tried using the home_url() function instead?
    https://codex.www.ads-software.com/Function_Reference/home_url

    Thread Starter kdcargile

    (@kdcargile)

    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:

    https://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);

    Thread Starter kdcargile

    (@kdcargile)

    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.

    https://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).

    Plugin Author Kevin Vess

    (@kevinvess)

    @kdcargile: Thanks for sharing your code –?have you tried passing a forward slash to the home_url() function?

    For example:
    $whitelist[] = home_url('/');

    Thread Starter kdcargile

    (@kdcargile)

    Thanks Kevin – that seems to be it!

    Thanks, this topic help me too.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Whitelist top page’ is closed to new replies.