Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show wire and user activity in blog instead of profile


  • TheMadcore
    Participant

    @themadcore

    Hi.

    I´m creating an art community with wpmu and buddypress, inspired on DeviantART.

    I want to show some user information on the frontpage of the user blog. Members have one blog assigned by default, and they can´t create another authors on them, and can´t give editor privileges to other users, so they are the only user and admin of their assigned blog. With that, I made some tweaks like when you want to view and author page on the blog, like member.site.com/author/member, is 301 redirected to their profile (site.com/members/member).

    In the blog frontpage, the home.php file, I want to show some info from the buddypress profile, like the activity and the wire. I know the tags, but I can´t figure how to make them work. Anyone can help me in that way?

    Thanks for your time.

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

  • tsalagi_red
    Participant

    @tsalagi_red

    I want to do this also. I am trying to figure out if I can have the blog and the wire/profile information side by side. Is this possible?


    Mariusooms
    Participant

    @mariusooms

    Eventhough this post was already 6 months old, this link should point you in the right direction:

    https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-wire-loop/


    r-a-y
    Keymaster

    @r-a-y

    Try this in your home.php:

    <?php if ( function_exists( 'bp_activity_get_list' ) ) : ?>

    <?php
    bp_activity_get_list(
    get_the_author_ID(), // The ID of the user to get activity for.
    bp_word_or_name( __( "My Activity", 'buddypress' ), __( "%s's Activity", 'buddypress' ), true, false ), // The title of the activity list.
    bp_word_or_name( __( "You haven't done anything yet.", 'buddypress' ), __( "%s hasn't done anything yet.", 'buddypress' ), true, false ) // What to show when there is no activity.
    );
    ?>

    <?php endif; ?>

    Untested… try it and report back. This will show the activity block, just like on a BP profile page.


    tsalagi_red
    Participant

    @tsalagi_red

    I’ve tried this. It doesn’t work and breaks the template.


    tsalagi_red
    Participant

    @tsalagi_red

    Thanks, Mariusooms. That code worked beautifully to get the wire posted. But how about the form to write to the wire? Any ideas on how to do that?


    Mariusooms
    Participant

    @mariusooms

    I imagine you have to use this function, which is a wp function for the current logged in user:

    <?php get_current_user_id(); ?>

    and have that set the bp id so you can use that id in bp functions.

    <?php bp_current_user_id(); ?>

    I tried a few things, but didn’t get any results unfortunately. Maybe a more experienced user could help. I remeber there are some answers in the forums as to how to pass the current blog user id as bp user id. Maybe do another search on that.

    Regards,

    Marius

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show wire and user activity in blog instead of profile’ is closed to new replies.
Skip to toolbar