JanP6468
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Viewing topic 1 (of 1 total)
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Redirect from limited content to login form
Started by: JanP6468
in: Toolset Professional Support
Problem: The issue here i that the user wanted to redirect hiss guests from certain pages to a login page. This can be done by using the code below. Add it to your function.php file function wpsites_redirect_login_page() { $arr = array('my-account', 'mijn-account/','add-your-first-bike','edit-bike','edit-profile','sell-bike','report-bike','add-bike','bike-reported'); if ( ! is_user_logged_in() && is_page($arr) ) { wp_redirect( 'my_url' ); exit(); } } add_action( 'template_redirect', 'wpsites_redirect_login_page' ); Finally just add the slug of your page to the array and it will automatically redirect to a url that you can specify |
2 | 13 | 6 years, 9 months ago |
Viewing topic 1 (of 1 total)