BuddyDev

Search

CSS needed

  • Participant
    Level: Initiated
    Posts: 10
    Gianluca Mirizio on #39692

    Hi there!
    I ma sorry but cannot reply to prevuous topic titled Add friend button does not appare.
    You provided me code and I put this into function file of child template.
    Now I need CSS as you wrote.
    The code I choos is

    ‘ // after activity header actions(first line).
    add_action( ‘bp_get_activity_action’, function ( $action ) {

    if ( ! is_user_logged_in() ) {
    return $action;
    }

    return $action . bp_get_add_friend_button( bp_get_activity_user_id() );
    } ); ‘
    As far as I understand thsi should appare on the right of …all members, my friends, etc….
    Thank you for your help.
    Gianluca

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #39694

    Hello Gianluca,

    Please take look at the screenshot and let me know Are you referring to this position?

    https://tinyurl.com/yzrbhor6

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 10
    Gianluca Mirizio on #39695

    yes!
    tks

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #39697

    Hello Gianluca,

    That’s not feasible because for adding a friend button we need a user id. But In your case, It is not possible to grab the user id over there. So, We can not help you much with this.

    Regards
    Ravi

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #39698

    Please hold on.

    The goal of the above code is to add the “Add Friends” button on each activity card(Individual activity entry).

    It can be moved to the right of that card. will that work?

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Gianluca Mirizio on #39699

    HI!
    Yes will be OK anyway!
    Thanks.
    Gianluca

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #39709

    Thank you. I will share it today.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #39815

    Hi,
    Sorry, for the delaye.

    Please add the following css to Dasboard->Appearance->Customize->Additional CSs

    
    .activity-header {
        display: flex;
        align-items: center;
        flex-flow: row wrap;
    }
    
    .activity-header .generic-button a {
        border: 1px solid #333;
        margin-left: 1em;
    }
    
    

    That should make it slightly better.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Gianluca Mirizio on #39852

    Hi there! and thanks.
    CSS code has been added as you explained but I see no changes.
    Where shoukld it appare?
    Thanks.
    Gianluca

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #39856

    Hi Gianluca,
    The above css should put the Add friends button on same line as header for larger screen. For smaller screen, It won’t have any effect as the button will be on the second line.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved