Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding a link to a user’s blog posts in BuddyPress profile


  • angeljs
    Participant

    @angeljs

    I allow frontend publishing for my users, and was wondering if there was a way to add a link to their posts within their BuddyPress profile page?

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

  • Henry Wright
    Moderator

    @henrywright

    You could use WP_Query. Here’s an example:

    $query = new WP_Query(
        array(
            'author' => bp_displayed_user_id()
        )
    );
    if ( $query->have_posts() ) {
        while ( $query->have_posts() ) {
            $query->the_post();
            echo get_the_title();
            // Output more stuff here if you like.
        }
        wp_reset_postdata();
    } else {
        // No posts found.
    }

    angeljs
    Participant

    @angeljs

    Where do I place that, please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar