Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to redirect non-member to registration form


  • boogieboa
    Participant

    @boogieboa

    Hi there,

    How do we make site visitors who are not logged-in redirect to a registration page when they click on any topic or post in the forum? It should be a code in functions.php, I think. Any suggestions?

    It would be great to automatically send them back to where they came from once registration is complete. Is this possible?

    Many thanks,
    B

Viewing 7 replies - 1 through 7 (of 7 total)

  • Robin W
    Moderator

    @robin-w

    nothing I know of does this exactly

    In

    bbp style pack

    dashboard>settings>bbp style pack>Topics index styling item 19

    you can add a register option


    boogieboa
    Participant

    @boogieboa

    Thank you for the tip.

    I’m hoping someone can suggest a non-pluggin option. I currently use GD bbPress Toolbox Pro (Version 5.8.9) with bbPress. It redirects non-members at forum level, but not at topic or post level, which is what I’d like to set up.

    Cheers


    Robin W
    Moderator

    @robin-w

    suggest you contact the GD bbPress Toolbox Pro author to se if he can help


    boogieboa
    Participant

    @boogieboa

    Thank you. What’s the best place to find a developer who can make adaptations like this?


    Robin W
    Moderator

    @robin-w


    chalkie1983uk
    Participant

    @chalkie1983uk

    You could use something like this in the functions.php file:

    function is_user_logged_in() {
        $user = wp_get_current_user();
     
        return $user->exists();
    }

    then look into adding a function in the bbpress like so:

    if ( is_user_logged_in() ) {
        {display the content}
    } else {
        {setup redirect}
    }

    Its a bit hard as you don’t want any plugins or addons, if you did it would be easier to just create a plugin which would automatically hook it in.


    boogieboa
    Participant

    @boogieboa

    Thank you, @chalkie1983uk. Where in bbpress would the second snippet of code go?

    I’ve got 28 plugins installed. I’m not trying to add any more.

    Cheers

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar