Forums

[resolved] listing a special author's posts (4 posts)

  1. lametiger
    Member
    Posted 2 years ago #

    Hey,

    I want to list the posts of a certain author on a profile-page. Author XYZ, description, posts... Something like a Social-Network site.

    For this purpose I'm writing a special template.

    But I already search for hours and didn't find a solution.

    Can anybody help me out?

    Thanks a lot!

  2. MichaelH
    Volunteer
    Posted 2 years ago #

  3. lametiger
    Member
    Posted 2 years ago #

    Thank you. This was not what I was looking for, but finally I found a solution:

    $myposts = get_posts('author='.$userID.''); ?>
    
    <?php foreach( $myposts as $post) : 
    
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    <?php the_time('d.m.Y, H:i'); echo " Uhr" ?>
    
    <?php endforeach; ?>

    This works :)

  4. lametiger
    Member
    Posted 2 years ago #

    PS: This is how I got the $userID ...

    <?php
          global $current_user;
          get_currentuserinfo();
          $userID = $current_user->ID;
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic