Skip to:
Content
Pages
Categories
Search
Top
Bottom

hide bp homepage for loged in users


  • Gunjesh Gaurav
    Participant

    @gunjesh123

    My site is in final stage but a last problem, i want to redirect my bp loged in users to main activity page when they click on hompage, i have tried to modify theme function but couldnt successful.i have also tried some plugin but it did not work,so please can anyone help me. Its very urgent. Any idea and suggestion will be accepted.thank you in advance.

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

  • Matt McFarland
    Participant

    @matt-mcfarland

    drop the following into your functions.php file:

    
    function my_login_redirect(){
       return home_url().'/activity';
    
    }
    add_filter("login_redirect", "my_login_redirect", 10, 3);
    

    Matt McFarland
    Participant

    @matt-mcfarland

    that is after login,

    to change home page, what are you using for your home page button?

    You’ll need to use is_user_logged_in() and output a different a href depending on the result. You’ll also want to hardcode the menu link into your template (ie: not use the wp nav menu for home buttons) take a look at header.php!

    hope this helps.


    sylviaivie
    Participant

    @sylviaivie

    I’m doing this with a wp plug in called Menu Items Visibility Control in conjunction with s2member.

    Once it’s activated, Go to the menu area, click the drop down on the Home menu item name and under visablilty do your conditional.

    Mine looks like this. (! at the beginning means they can’t) So when they are logged in the menu item won’t appear.

    !current_user_can(‘access_s2member_level1’)

    Sorry I don’t know exactly what you would put unless you have s2member


    Matt McFarland
    Participant

    @matt-mcfarland

    thanks for sharing slyviavie, is nice there is a plugin for this.


    sylviaivie
    Participant

    @sylviaivie

    you are welcome Matt there is one for Widgets that works similarly. show or hide them based on users log in status. That one is called “Widget Logic” same type of thing, drag and drop your widget, then set the conditional.


    Gunjesh Gaurav
    Participant

    @gunjesh123

    I dont use any home buttom or menu for homepage.my site usage header (included link) for homepage in frisco theme.by the way thanks both of you for your advice. I will try this,then tel you.


    sundev
    Participant

    @sundev

    There’s a plugin that redirect user to their profile activity when logged.
    link here: https://wordpress.org/plugins/bp-redirect-to-profile/


    Gunjesh Gaurav
    Participant

    @gunjesh123

    I have already rewrite the login and logout rules.i am trying to restrict homepage only for logedin users (not admin) and redirect them to another bp page when they try to go on homepage like facebook style homepage.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘hide bp homepage for loged in users’ is closed to new replies.
Skip to toolbar