Skip to:
Content
Pages
Categories
Search
Top
Bottom

show header item when user not login in buddypress

  • @maan18

    Participant

    when i was not login in buddypress the header item buttons in user profiles is not show up and i was trying to show user header item buttons like add friend, follow and send private message in buddypress but it will need required to user login to add add friend, follow and send private message just like this Link . there is any way to do this in buddypress.

Viewing 9 replies - 1 through 9 (of 9 total)
  • @bphelp

    Participant

    @maan18
    I am not certain I understand your requirement but you can try:
    https://github.com/bphelp/private_community_for_bp_lite

    @maan18

    Participant

    @bphelp Thank for your reply. my question is simple. i need to show member header item which include (add friend, send private message etc). which are not showing when user are not login. i need to remove login to see header item button condition . any way to do this.

    @henrywright-1

    Member

    ‘Add friend’ and ‘send private message’ aren’t supposed to display when a user is logged out. For example, how would BuddyPress know who the friend request came from? How would BP know who the private message came from?

    @maan18

    Participant

    @henrywright-1 i need show button only but when user click on any button it required to login or Register to add or send message. same as like this theme Link

    @henrywright-1

    Member

    @maan18

    I’m not sure what you’re asking exactly but take a look at this:

    <?php 
           if ( is_user_logged_in() ) { 
           // whatever you put here will be displayed if the user is logged in
           } else { 
           // whatever you put here will be displayed when logged out
           } 
    ?>

    @maan18

    Participant

    not working.

    @henrywright-1

    Member

    @maan18

    it should work, I have used this approach many times.

    @maan18

    Participant

    but it’s not working in member-header. is there any thing wrong in my code:

    <div id="item-buttons">
    <?php 
           if ( is_user_logged_in() ) { 
           do_action( 'bp_member_header_actions' );
           } else { 
           do_action( 'bp_member_header_actions' );
           } 
    ?>
    			
    
    		</div><!-- #item-buttons -->

    @henrywright-1

    Member

    @maan18

    Your code is outputting the exact same line of code to both logged in users and logged out users:

    do_action( 'bp_member_header_actions' );

    The idea of an ‘if’ statement is to output different code based on certain criteria being met.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘show header item when user not login in buddypress’ is closed to new replies.
Skip to toolbar