Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I redirect to /forum after login?


  • ccarlow
    Participant

    @ccarlow

    New install of bbpress v2.7.5 on wordpress v4.2.2

    Question: How can I redirect to /forum after login? I have forum page set as a private page. bbpress forums need to be private and only accessed by registered users.

    I have searched for info on how to login/register and then redirect to a forum and haven’t been successful in finding a simple solutions. Some solutions look too complicated regarding writing code. I would assume there is a simple solution here.

    I have tried a redirect plugin (peter’s) and doesn’t work for bbpress users set with any bbpress role but does work if I login in as wp-admin with wp admin rights.

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

  • Robkk
    Moderator

    @robkk

    Peter’s Login Redirect plugin should work for what you want to do.

    I am guessing since you are saying “forum page” and you made that private , that you created a page and put the forum index shortcode in it.

    Well since you chose to make that page private , it makes sense that Admin rights can only see it.

    https://codex.wordpress.org/Content_Visibility#Private_Content

    What you should do is just redirect to yoursite.com/forums and whatever forum you want private

    make the forum private by editing the forum and setting it to private there.


    ccarlow
    Participant

    @ccarlow

    Good guess! Sorry for the limited details but I wasn’t sure how or what to do to begin with. Your suggestion works perfectly and is all I need. Thanks for getting me on the right track! May the force be with you.


    Robkk
    Moderator

    @robkk

    May the force be with you.

    And with you 🙂


    peter-hamilton
    Participant

    @peter-hamilton

    I think (correct me if I am wrong) you can use this snippet in your functions.php

    function login_redirect( $redirect_to, $request, $user ){
        return home_url('forums');
    }
    add_filter( 'login_redirect', 'login_redirect', 10, 3 );

    I use this on my site onlijn.com and works good for me.

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