• Resolved superwhitepill

    (@superwhitepill)


    Hello,

    I’ll try to explain this as best I can. In the left column of the page i have a single post displaying (single.php). On the right side i’d like to display the 5 most recent post of this author.

    I’ve tried a few things with out success, below is the code i have so far:

    <?php if (have_posts()) : ?>
    				<?php $ff_query = new WP_Query('category_name=flash-fiction&posts_per_page=5');
                        while ($ff_query->have_posts()) : $ff_query->the_post();
                        $do_not_duplicate = $post->ID;
                        $illustration_variable = get_post_meta($post->ID, 'illustration', true);?>
                        <div class="single-page-sidebar-content">
                            	<img class="current-issue-cover float-left" src="<?php echo $illustration_variable; ?>" width="60" height="45" alt="<?php the_title(); ?>" />
                                <h3 class="flash-fiction-header"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" ><?php the_title(); ?></a></h3>
                                <p class="author-name"><?php the_author_firstname() ?> <?php the_author_lastname() ?></p>
                                <p class="break"><?php the_excerpt(); ?></p>
                                <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" ><p>continue reading</p></a><p class="date-right"><strong><?php the_time('F j Y') ?></strong></p>
                            </div>
                        <?php endwhile; ?>
                        <?php else : ?>
                            <h2 class="center">Not Found</h2>
                            <p class="center">Sorry but you are looking for something that isn

    t here.</p>
    <?php include (TEMPLATEPATH . “/searchform.php”); ?>
    <?php endif; ?>
    `

    I tried to work out some condition in this part ‘WP_Query(‘category_name=flash-fiction&posts_per_page=5′);’ to add to the query but I just got the 5 most recent posts regardless of author so I removed it.

    Any insight into this would be great.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying additional post by current author post’ is closed to new replies.