• At the bottom of my posts page (single.php) i would like to add some code to display sliding list of posts by the same user (author).

    I have the siding code and the thumbnails already running on my site i just cat figure out how to edit it so i displays only post by the same user.

    here is the slide code https://pastebin.com/pK9LMCA3

    but where can i edit so it displays posts by the user <?php the_author(); ?>

    also might need to add an if statement to only display the box/div if there are other posts

Viewing 1 replies (of 1 total)
  • Thread Starter kitcorsa

    (@kitcorsa)

    I can display a list of posts by adding the following to my functions file
    function get_related_author_posts() {
    global $authordata, $post;

    $authors_posts = get_posts( array( ‘author’ => $authordata->ID, ‘post__not_in’ => array( $post->ID ), ‘posts_per_page’ => 5 ) );

    $output = ‘

    ‘;

    return $output;
    }

    and added the function to the single.php post page, but i would like the thumbnails as well, i could loose the sliding function TBH

    if i could just display the thumbnail and the latest 3 posts that would be cool

Viewing 1 replies (of 1 total)
  • The topic ‘Display related posts by author with thumbnail’ is closed to new replies.