WordPress.org

Forums

Profiles? (5 posts)

  1. Anonymous
    Unregistered
    Posted 11 years ago #

    Hi, I don't know if this is the right forum but I was wondering if there was a way to display profiles for the contributors.
    Or a way to display posts by contributor rather than by category.
    Thanks for any help :)

  2. Mark (podz)
    Support Maven
    Posted 11 years ago #

    There was a hack (wp-people : http://www.dean-logan.com/forum/viewtopic.php?t=6 ) for something like the bio / profile, but I've not seen that updated for ages. It may not work with 1.2mingus
    And posts by author ? Not yet seen .... it has been requested though several times, so it could be coming soon I guess.

  3. Anonymous
    Unregistered
    Posted 11 years ago #

    Hi again,
    What I actually meant was for the authors... Instead of having:
    Filed under: Blah � Author @ 2:35 pm
    To have the same but with the Author made into a link to the profile of said author.
    A bit like the thing that happens on a community LiveJournal. :)

  4. Anonymous
    Unregistered
    Posted 11 years ago #

    You can substitute the author's name here with the the_author_posts_link(); function to display a page that contains all the posts by a specific user, from that page, extra customatization can be done on that page by inserting author information after if ($author)...
    <pre>
    if ($author) {
    echo('
    <div class="post">
    <div class="storytitle">'."\n");
    echo('<img class="right" src="images/'.$author.'.jpg" />');
    get_author_bio($id=$author);
    echo('
    <div style="clear:both;"></div>
    ');
    echo('</div>
    ');
    }
    </pre>
    For our multi-author site we used a function to display a picture and the bio entered by each author in the "User Information" page.
    <pre>
    // Show an author's information outside the loop
    function get_author_bio($id)
    {
    global $wpdb, $id,$authordata;
    $query = "SELECT ID, user_nickname, user_firstname, user_lastname, user_nicename, user_description, user_url, user_email from $wpdb->users " . "WHERE ID=$id ORDER BY user_nickname";
    $authors = $wpdb->get_results($query);
    foreach($authors as $author) {
    if ($author->user_url) {
    echo '
    <h3>user_url.'">';
    echo $author->user_nickname.'
    </h3>
    ';
    } else {
    echo '
    <h3>'.$author->user_email.'</h3>
    ';
    }
    echo '
    <div class="author">�'.$author->user_description.'</div>
    ';
    }
    }
    </pre>
    Check out cnwp for a screenshot of that site.

  5. sasha
    Member
    Posted 10 years ago #

    Since I'm new to PHP and CSS, I didn't understand a word you said. Here's an easier version that may help some people (also posted in its own thread and to the wiki)

    This takes that "posted by authorname" text on your blog page and changes the authorname to a link. When you click the link it lists all the posts by that author.

    In your index.php, change

    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> �
    <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>

    To

    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> �
    <?php the_author_posts_link(); ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>

    The only change is in that fourth tag, and mind the semicolon.

    You also link to those pages manually with links to http://www.whatever.com/blog/index.php?author=3

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.