New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

Insert content before Activity page

  • Participant
    Level: Enlightened
    Posts: 25
    imborx on #25438

    Hi, I would like to insert some content before the buddypress activity page content and I would like to know if it is posible. I check some articles like: https://buddydev.com/inject-content-into-buddypress-activity-stream-after-a-certain-number-of-activities/ and I know that exist a shortcode to use activity stream in any page (https://es.wordpress.org/plugins/bp-activity-shortcode/), but I’d need to add some custom content (not just text… some images, shortcodes or videos) before the main content.

    Thanks a lot!

  • Keymaster
    (BuddyDev Team)
    Posts: 25509
    Brajesh Singh on #25441

    Hi,
    BuddyPress provides you a hook to add content before activity directory . You can attch to

    
    bp_before_directory_activity
    

    action.

    example.

    
    
    add_action( 'bp_before_directory_activity', function () {
    	echo "hello activity";
    } );
    

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 25
    imborx on #25480

    Hi Brajesh,

    So how can I place a content like this into that code?

    “[mk_page_section sidebar=”sidebar-1″][vc_column][mk_fancy_title tag_name=”h3″ size=”24″ font_weight=”600″ margin_bottom=”5″ font_family=”none” align=”center”]Contacta con nosotros[/mk_fancy_title][mk_contact_form button_text=”ENVIAR MENSAJE” phone=”true” captcha=”false”][/vc_column][/mk_page_section]”

    Could I place just in the “hello activity” text?

    Thanks!

  • Keymaster
    (BuddyDev Team)
    Posts: 25509
    Brajesh Singh on #25483

    Please use

    
    
    echo  do_shortcode( "Your content ");
    
    

    you will need do_shortcode to render the content from shortcode.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved