biglaug
Forum Replies Created
-
Forum: Plugins
In reply to: [Restricted Site Access] How to Exclude a pageSure @nilpix 🙂
Look at my example above$wp->query_vars['name'] == 'a-name-of-a-post'
is for specific postswhile:
$wp->query_vars['pagename'] == 'name-of-a-page'
is for pagesIf you want the homepage to be visible you probably should set a specific page to be the home page and not the latest post (which is the default on most WP-templates) in the settings.
Forum: Plugins
In reply to: [Restricted Site Access] How to Exclude a pageI had the same problem (wanting the registration-page to be visible to non-members) and came up with a solution. Worked for me at least…
I really hope the plugin-author can comfirm this as a valid solution? 😉
add_filter( 'restricted_site_access_is_restricted', 'my_restricted_check' ); function my_restricted_check( $is_restricted ) { global $wp; if ( $wp->query_vars['pagename'] == 'register' || $wp->query_vars['name'] == 'a-name-of-a-post' ) $is_restricted = false; return $is_restricted; }If you’ll try a
print_r($wp->query_vars);you can see where I get the names from.Yup – updating both WP (3.5.2) and WPUF (1.2.2) did the trick. And it didn’t mess up other plugins (phew) 🙂
Thanks, artheme 🙂
Didn’t work for me. It must have something to do with the versions on wpuf and wp, and/or another plugin interfering. It worked well before but can’t pinpoint where or when exactly the problem occurred.I’ll keep it up 🙂
Also have this problem.
No error on firebug either…