Simple User Listing
Re-add 'Latest Post' (2 posts)

  1. GizmoHKG
    Posted 3 years ago #

    Good evening!

    The original plugin on SM echoed the latest post by each author:

    <?php $latest_post = new WP_Query( "author=$author->ID&post_count=1" );
    			if (!empty($latest_post->post)){ ?>
    			<p><strong>Latest Article:</strong>
    			<a href="<?php echo get_permalink($latest_post->post->ID) ?>">
    				<?php echo get_the_title($latest_post->post->ID) ;?>
    			<?php } //endif ?>

    Any idea how to re-add that part back into your plugin? I've tried a few times but to no avail, it keeps echoing the latest post regardless of the author.

    Many thanks in advance!!


  2. helgatheviking
    Plugin Author

    Posted 3 years ago #

    Your args are messed up from mixing a PHP variable into a string. Try switching to the array method.

    You also not have a loop.

    Take a look at the codex.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple User Listing
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.