This topic has 15 replies, 2 voices, and was last updated 6 years by Kieran_SQ.

  • Author
  • #166823
     Grant
    Participant

    Hi Guys,

    I would just like to redirect a new user to a custom page ‘after buddypress activation’ is done via email. The default page is rather ‘ugly’ to say the least. See attached. I’ve removed the username/password.

    So I simply want to redirect the user to a nicer looking page which I’ll design.

    While I have tried a range of buddypress plugins and functions that claim to do this – all have failed. This leads me to think that maybe there is some custom code in your kleo theme which is preventing them from working.

    Do you have a simple solution to do a page ‘redirect’ directly AFTER the buddypress activation by email has been triggered and activated the account?

    Much Appreciated,

    Grant

    Attachments:
    You must be logged in to view attached files.
    #166830
     Kieran_SQ
    Moderator

    Hi @Grant,

    I can’t imagine there is anything in KLEO that would restrict a standard redirect. You could try the following

    There’s plugin called “BuddyPress Autologin on Activation” which can be found here https://buddydev.com/plugins/bp-autologin-on-activation/. This automatically logs the user in when they activate their profile, by default the plugin directs the user to their profile, however, if you read the comments on this page https://buddydev.com/buddypress/auto-login-the-user-after-account-activation-on-buddypress-based-social-networks/#comment-100947 you’ll see that the developer offers a custom snippet for redirecting elsewhere.

    That code being:

    COPY CODE
    add_fllter('bpdev_autoactivate_redirect_url','redirect_to_edit_profile');
    function redirect_to_edit_profile($user_id){
     
    return bp_core_get_user_domain($user_id )."profile/edit/";
    }

    Let me know if this works for you,

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #166844
     Grant
    Participant

    Hi Kieran,

    Thanks for the quick response.

    I have tried that plugin/script already. What happens is that it ‘kind of works’. The email activates the user BUT then returns them to a ‘blank page’ on the site. When I try to add that redirect filter to the child function file, it kills the site.

    So still wondering what could be causing this. I am using the Gravity Forms ‘User Registration’ add-on. It could possibly be interfering. I’ll drop them an email and see what they say.

    Cheers,

    Grant

    #166845
     Kieran_SQ
    Moderator

    Hi Grant,

    Let me do some testing on this and I will get back to you in a few hours. Thanks for your patience.

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #166853
     Grant
    Participant

    Cheers Mate,

    If I can just get a ‘redirect’ to work away from that very poor buddypress activation confirmation, I’ll be happy.

    Thanks.

    #166866
     Kieran_SQ
    Moderator

    Hi @Grant,

    Please try adding this to your child theme’s functions.php file

    COPY CODE
    // Do page redirect if just activated
    function seventh_queen_redirect_if_user_just_activated() {
    if ( bp_account_was_activated() ) {
    	wp_redirect( home_url( '/thispage/' ) );
            exit();
    }
    }
    add_action( 'template_redirect', 'seventh_queen_redirect_if_user_just_activated' );

    Replace /thispage/ with your own page

    Let me know if this works for you,

    Thanks,

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #166868
     Kieran_SQ
    Moderator

    Side note:

    Make sure to exclude /activation/ (or the page you’re using for activation) from your cache as well as the page you’re redirecting to – this will limit any issues with the redirect.

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #166880
     Grant
    Participant

    Hi Kieran,

    Thanks so much for your efforts. Unfortunately it made no difference. The default Activation page displayed as per normal. No redirect occurred.

    There is no chance of any caching affecting this operation. All caching is disabled. I’m operating in ‘development mode’ so am not caching any pages. Has this code worked on a test setup?

    I’ll check a clean setup now and report back to you.

    Cheers Mate.

    #166881
     Grant
    Participant

    Hi Mate,

    Just did another check and same result. It activates – but does not redirect.

    As I’m not a code expert (more jack of all trades), I have to rely on the wonderful support of people like yourself when faced with these odd coding issues which I cannot solve with a suitable plugin or function borrowed from the global world of ‘google the almighty’! 😉

    Do you remember what life was like BG (Before Google)? Trust me – a lot tougher! At least its not quite as hard to find information like it used to be.

    Cheers!

    #166927
     Kieran_SQ
    Moderator

    That’s odd, I tested it on a live site with 5 sign ups and it worked every time for me. I will look into this further for you today.

    Are you running latest BuddyPress, WordPress & KLEO? Any other redirects in place? Any of the redirect options set within the KLEO theme? What other plugins are you using on your site? Do you have any other custom code in functions.php?

    Also, try removing the code from functions.php and placing it in bp-custom.php (see here for more info on that https://codex.buddypress.org/themes/bp-custom-php/).

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #166932
     Kieran_SQ
    Moderator

    Also, I tried to signup for your website to test it, but I did not receive an activation email.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #166944
     Grant
    Participant

    Hey Mate,

    Just leave it for now as I’m constantly testing and restoring from backup so things won’t be working properly.

    Thanks so much for all your support. I want to do the activation part very professionally and have come across what looks like a nice solution using a ‘Gravity Perks’ solution.

    I’ll keep you posted on the outcome.

    Cheers!

    #167152
     Grant
    Participant

    Hi Mate,

    I want to thank you for your awesome support and recent efforts. I also said that I’d get back to you when I’d checked out an option that I came across which looked ideal. Here’s a heads-up with some info that could prove helpful to others as well. Take a look at this link.

    https://gravitywiz.com/documentation/gravity-forms-better-user-activation/#activation-success

    This is the solution I ended up using as it integrated perfectly with the registration process I have. I use the GF User Registration Add-On for BuddyPress registrations and it integrates with that. So it was a no-brainer.

    There is only one last piece that I would like to graphically improve in terms of the registration process which is to add a ‘header logo’ to the AJAX modal login window – like what you do if someone chooses facebook login support. See the attached graphics.

    I just want to add our our logo header to the AJAX modal login – not the FB one. Is there a bit of CSS code that allows this to be done?

    Cheers,

    Grant

    Attachments:
    You must be logged in to view attached files.
    #167177
     Kieran_SQ
    Moderator

    Hi Grant,

    Thanks for keeping me updated and I’m glad you got it sorted. The CSS below is based off your logo, you’ll need to create an image with more white space either side for this to look okay. You may also need to tweak this CSS a little to suit the new image.

    COPY CODE
    #login_form {
        padding-top: 80px;
        background: url(../wp-content/uploads/2016/11/logo-small.png);
        background-repeat: no-repeat;
        background-size: contain;
    }

    Let me know if this works for you.

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #167237
     Grant
    Participant

    Magic Mate – Thanks!

    That pointed me in the right direction. I needed the logo to be placed at the top so ended up using this CSS.

    .kleo-pop-title-wrap {
    padding-top: 80px;
    margin-top: 70px;
    background: url(/images/modal-logo.png);
    background-repeat: no-repeat;
    background-size: contain;
    }

    See the attached for the final result in case others in the community want to do the same.

    Cheers!

    Attachments:
    You must be logged in to view attached files.
    #167245
     Kieran_SQ
    Moderator

    Hey,

    Glad it worked for you, sorry for the misunderstanding on the location on my part, I read what you posted wrong.

    Looks great by the way!

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

Viewing 16 posts - 1 through 16 (of 16 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?