-
Author
-
July 13, 2017 at 22:33 #167354vidjayleeParticipant
Hi,
i use this code to redirect guests to register page.
<?php /** * Restrict users to your site and redirect them to register page * @author SeventhQueen * * @return void */ function sq_restrict_my_website(){ global $pmpro_pages; if(!is_user_logged_in() && ( function_exists(‘bp_is_active‘) && ! bp_is_register_page() ) && $GLOBALS[‘pagenow‘] !== ‘wp-login.php‘ && ( !empty( $pmpro_pages ) && !is_page($pmpro_pages) )){ wp_redirect(wp_registration_url()); exit(); } } add_action(‘template_redirect‘, ‘sq_restrict_my_website‘); I would like to show a message in register page only after the redirection, i’m noob in javascript
July 14, 2017 at 17:56 #167430LauraModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! ?Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
July 17, 2017 at 18:48 #167710RaduModeratorHi,
What’s the page URL where user it’s redirected if done’t have mermbership ?
In this way, i can do a condition and to add a message to that page via PHP.
Let me know
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 18, 2017 at 18:29 #167836RaduModeratorHi,
Add this code to functions.php
COPY CODEfunction check_is_register_page() { if(is_page('register') && !is_user_logged_in()) { echo 'This is my custom message for the register page for guest users'; } } add_action('bp_before_signup_profile_fields', 'check_is_register_page');
It will display a message for guest users. Message by referring location isn’t possible at this moment.
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 21, 2017 at 17:14 #168206RaduModeratorYou’re welcome
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.