BuddyDev

Search

[Resolved] Add "featured" content at top of "community activity update" page


  • Participant
    Level: Master
    Posts: 260
    evillizard on #26260

    Hello boss, please How do i put AN IMAGE or “featured image” at the top of the “buddypress activity community update” page

    And write something below like: “this is our member of the month”

    E.g

    “I want to be able to put an image or featured image => https://postimg.cc/3dx5gLvh

    .. of my page to show somewhere around here => https://postimg.cc/PCqX5X4m

    “AND ALSO SOME WRITE UP BELOW” So it would look something like this=> https://postimg.cc/dDH67nRg

    How would i be able to do?

    I also found this post= https://buddypress.org/support/topic/featured-image-not-displaying-on-page/

    Or maybe something similar like this plugin that adds a content on any post => https://wordpress.org/plugins/add-widget-after-content/


  • Keymaster
    Level: Guru
    (BuddyDev Team)
    Posts: 853
    Ravi on #26264

    Hello,

    Thank you for posting. If you want to show user image before activity directory. You can use the following code.

    
    add_action( 'bp_before_directory_activity', function() {
    // Replace item id by your user id. I am assuming logged in user id.
    	echo bp_core_fetch_avatar( array( 'item_id' => bp_loggedin_user_id(), 'type' => 'full' ) );
    } );
    
    

    Regards
    Ravi


  • Participant
    Level: Master
    Posts: 260
    evillizard on #26265

    Hi @ravi

    
    
    add_action( 'bp_before_directory_activity', function() { // Replace item id by your user id. I am assuming logged in user id. 	echo bp_core_fetch_avatar( array( '114' => bp_loggedin_user_id(), 'type' => 'full' ) ); } );
    
    

    – the user id is “114” ….trying to add that in functions.php ..but its not working…the editor keeps rolling it back cos of an error

    ..

    And also

    How do i put a text underneath the photo like: “employee of the month” ??

    • This reply was modified 1 week ago by  evillizard.

  • Keymaster
    Level: Guru
    (BuddyDev Team)
    Posts: 853
    Ravi on #26276

    Hello

    Try this code

    
    add_action( 'bp_before_directory_activity', function() {
    // Replace item id by your user id. I am assuming logged in user id.
    	echo bp_core_fetch_avatar( array( 'item_id' => 114, 'type' => 'full' ) );
            echo '<p>Employee of the month</p>';
    } );
    
    

  • Participant
    Level: Master
    Posts: 260
    evillizard on #26282

    Hello @ravi

    ,

    The code keeps giving this error:

    => https://postimg.cc/8JtzyWM5

    Could it be because i am.using a mobile phone???

    I got to do something similar with this plugin => https://buddydev.com/plugins/bp-activity-shortcode/

    Look at how i didnt it on a page by jst putting tbe [activity stream] short code under the pic…and it looks good like this => https://postimg.cc/cttGQ8cP

    ..

    But this plugin doesnt show or doesnt have this “WHATS NEW, stuff” => https://postimg.cc/rRxYVGjy

    For people to type and say stuff in the community


  • Keymaster
    (BuddyDev Team)
    Posts: 12763
    Brajesh Singh on #26290

    Your problem is due to incorrect copying.

    Please copy it on a desktop and It should work.

    For the plugin, Please check the plugin page. You will find the way to enable posting.

    Regards
    Brajesh


  • Participant
    Level: Master
    Posts: 260
    evillizard on #26297

    Hi boss

    -alright ild try it as soon as i get on a DESKTOP


    You also said:
    //For the plugin, Please check the plugin page. You will find the way to enable posting.//

    Do You mean this => https://postimg.cc/6yRCLC3Q

    Yes i have tried putting:

    [activity stream allow_posting]

    On the page…

    But it doesnt give an area for posting (it only shows the activity stream)

    *except im putting the shortcode wrongly* , im not really familiar with how to use shortcodes i am sorry…


  • Participant
    Level: Master
    Posts: 260
    evillizard on #26298

    This was how i put the shortcode:

    https://postimg.cc/bSq46hnv

    Perhaps i am not doing it the right way??


  • Keymaster
    (BuddyDev Team)
    Posts: 12763
    Brajesh Singh on #26305

    Please try
    allow_posting=1

    Regards
    Brajesh


  • Participant
    Level: Master
    Posts: 260
    evillizard on #26323

    Its not working still.. But it showed this rectanglar stuff:
    https://postimg.cc/S2Fc7MX8

    Also About this code that @ravi shared =
    `add_action( ‘bp_before_directory_activity’, function() {
    // Replace item id by your user id. I am assuming logged in user id.
    echo bp_core_fetch_avatar( array( ‘item_id’ => 114, ‘type’ => ‘full’ ) );
    echo ‘<p><a href=”https://banditmouse.com”>Employee of the month</a></p>’;
    } );`

    – is there away i can put or align it (the profile photo) to the center or to the middle …. And also link to THAT PARTICULAR PROFILE

    so that when its clicked it goes to the “EMPLOYEE OF THE MONTHS” profile

    ..

    • This reply was modified 4 days, 18 hours ago by  evillizard.
    • This reply was modified 4 days, 18 hours ago by  evillizard.
    • This reply was modified 4 days, 18 hours ago by  evillizard.

The topic ‘ [Resolved] Add "featured" content at top of "community activity update" page’ is closed to new replies.

This topic is: resolved
Subscribe