Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add a blog tab in profile page

  • @alexterchum

    Participant

    Hi, I would like to ask how to add a tab naming ‘blog’ in each user’s profile page,
    and it would show posts written by that author(looks like archives/author/username)
    I’ve followed the instructions in
    while I think I’m struggling in get_template_part( 'directory-to-content-file' );part
    what should it be?! Please help. Thanks a lot.

    WordPress version 4.1.1, BP 2.2.2.1

Viewing 3 replies - 1 through 3 (of 3 total)
  • @danbp

    Participant

    @alexterchum

    Participant

    Hi @danbp
    Tried the code, only the first snippet worked while adding second snippet would result in blank page error.
    And then I tried the slightly rewamped version, posts are properly displayed.
    However, I would like to have a list of posts with hyperlinks instead of displaying the whole content. Is that possible to make it happen? thanks

    @shanebp

    Moderator

    I would like to have a list of posts with hyperlinks instead of displaying the whole content.


    @alexterchum
    – his code kindly provides explicit instructions for doing exactly that.
    Did you read them?
    Here is what you need:

    foreach($myposts as $post) {
       setup_postdata( $post );
       echo '<a href="' . get_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a><br/>';			
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add a blog tab in profile page’ is closed to new replies.
Skip to toolbar