Latest Posts by Author
Automatically display all your own posts? (4 posts)

  1. nicholasbarry
    Posted 4 years ago #

    I see that you can manually specify a particular user. But is there a way to have the list automatically display the latest posts by whoever is logged in? I'd like each author to be able to see a list of their own latest posts.


  2. Alex Mansfield
    Plugin Author

    Posted 4 years ago #

    No, this feature is not built into the plugin. I believe you could modify the plugin using the wp_get_current_user() function and hopefully come up with something pretty close to what you're describing though.


  3. nicholasbarry
    Posted 4 years ago #

    Ok, I found a solution. First, I'm using the Shortcode Exec PHP plugin to allow me to execute PHP on pages. Then I use this PHP:

    global $current_user;
        $my_posts = get_posts( array( 'author' => $current_user->ID, 'numberposts' => 100 ) );
        $output = '
        foreach ( $my_posts as $my_post ) {
            $output .= '
    <li><a>ID ) . '">' . apply_filters( 'the_title', $my_post->post_title, $my_post->ID ) . '</a>, (<a>ID . '&action=edit" target="_blank">Edit</a>)</li>
        $output .= '</ul>
        return $output;

    That loads all the posts by whoever's logged in (up to 100). If you're not logged in, it just shows all the posts (up to 100).

  4. Alex Mansfield
    Plugin Author

    Posted 4 years ago #

    I'm glad to hear you found a solution! Thanks for posting it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Latest Posts by Author
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic