Title: Shortcode to Selectively Display Published Users Only
Last modified: November 14, 2017

---

# Shortcode to Selectively Display Published Users Only

 *  [backpackingseries](https://wordpress.org/support/users/backpackingseries/)
 * (@backpackingseries)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-display-published-users-only/)
 * Hello,
 * Is there a way to selectively display only those users who have published posts?
   My site has regular readers and authors (both with user role of a subscriber).
 * How can I generate and display a list of only those with published posts (and
   provide an exclusion for, say admins)? What could be a valid shortcode for such
   a query?
 * Kind regards,
 * Abhijeet
    -  This topic was modified 8 years, 5 months ago by [backpackingseries](https://wordpress.org/support/users/backpackingseries/).

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Sunil Bajracharya](https://wordpress.org/support/users/scottbadger/)
 * (@scottbadger)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-display-published-users-only/#post-9683967)
 * Hello, backpackingseries!
 * Thank you for writing in.
 * We a bit confused here.
 * What are you using to make subscriber able to publish posts? Are the posts credited
   to the registered subscriber?
 * Do you want to generate a list of all authors or are you still referring to the
   Author Box below the post?
 * If you just want to create a page with all author boxes then you can use the 
   shortcode `[ultimate_author_box user_id="1"]`
 * With the user_id parameter, you can refer to the How to use section of the plugin
   for further detail reference.
 * Any further elaboration would be a great help.
 * Thank you!
 *  Thread Starter [backpackingseries](https://wordpress.org/support/users/backpackingseries/)
 * (@backpackingseries)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-display-published-users-only/#post-9684028)
 * Hi [@scottbadger](https://wordpress.org/support/users/scottbadger/)
 * Thank you for your response and the query. My apologies there. I should have 
   been specific.
 * > What are you using to make subscriber able to publish posts? Are the posts 
   > credited to the registered subscriber?
 * I am using this [snippet from Stackexchange](https://wordpress.stackexchange.com/questions/50827/select-subscriber-as-author-of-post-in-admin-panel)
   to list all users in the dropdown list. It allows me to assign authorship to 
   any subscriber without a corresponding increase in backend role. However, not
   all subscribers have published posts.
 * > Do you want to generate a list of all authors or are you still referring to
   > the Author Box below the post?
 * Yes, I want to generate a list of all authors to display on a specific page. 
   For all practical reasons, your brilliant plugin replaces my author template.
 * > If you just want to create a page with all author boxes then you can use the
   > shortcode [ultimate_author_box user_id=”1″]
 * I am using this method at the moment. But it stands the risk of oversight (accidental
   exclusion) and an added administrative step after each post is published. I would
   like to automate this process – as if this is my author template page.
 * I would really appreciate your advise to achieve this.
 * Kind regards
 * Abhijeet
 *  [Sunil Bajracharya](https://wordpress.org/support/users/scottbadger/)
 * (@scottbadger)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-display-published-users-only/#post-9684073)
 * Hello, backpackingseries!
 * Thank you for writing back.
 * Just to be clear, you just want to create a Author Archive page?
 * If you want a dynamic code then try this:
 * If you are using php, you can simply use get_user_meta( ) to get an array of 
   user details, run a foreach loop, fetch the user id, use count_user_posts to 
   check if the current user has any posts and run the shortcode only if there is
   any post.
 * Hope this helps.
 * Thank you!
 *  Thread Starter [backpackingseries](https://wordpress.org/support/users/backpackingseries/)
 * (@backpackingseries)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-display-published-users-only/#post-9684135)
 * Hi [@scottbadger](https://wordpress.org/support/users/scottbadger/)
 * Thanks very much once again. Yes, I want to create a custom author-archive page
   using your plugin. (_I do not want to use the default WordPress author archive_)
 * I was hoping to achieve this with an **Ultimate Author Box Lite** shortcode but
   it sounds tad bit more complicated than that! 🙂 I am not much of a programmer
   and have only managed to stitch together a site-specific plugin (PHP) with code
   snippets from helpful developers, like yourself, on Stackexchange and WordPress
   forums.
 * So, if I may ask: are you suggesting to insert a code (1) in my (PHP) site-plugin
   or (2) on the custom page for site authors? Any further instructions are welcome.
   Also, would you have a snippet for me to try? Please advise.
 * Kind regards
 *  [Sunil Bajracharya](https://wordpress.org/support/users/scottbadger/)
 * (@scottbadger)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-display-published-users-only/#post-9684161)
 * Hello, backpackingseries!
 * Thank you for writing back.
 * I thought you had already figured our where to modify the code( my bad).
 * If I had to do it, I could create a theme page template and write all the code
   there and then simply assign the page template to one of the page created from
   WordPress and call it my Author List page.
 * Reference: [http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/](http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/)
 * I would leave the plugin code as it is and just create a additional theme page
   template .
 * You can use the
    `<?php add_filter( 'author_link', 'filter_function_name' ) ?
   >`
 * Reference: [https://codex.wordpress.org/Plugin_API/Filter_Reference/author_link](https://codex.wordpress.org/Plugin_API/Filter_Reference/author_link)
 * filter to then overwrite the default author link url and use it to redirect the
   link to your new author page.
 * Thank you!
 *  Thread Starter [backpackingseries](https://wordpress.org/support/users/backpackingseries/)
 * (@backpackingseries)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-display-published-users-only/#post-9684216)
 * Hi [@scottbadger](https://wordpress.org/support/users/scottbadger/)
 * Thanks very much for that direction 🙂 I think I can manage to create the custom
   page template and try some code with count_user_posts conditional check.
 * Should there be a plan to include such a feature (that allows using a shortcode
   with a parameter, say, `[ultimate_author_box displayusers="all" user_has_posts
   ="true"]`) in your plugin’s future versions, I would be delighted to update!
 * Kind regards,
 * Abhijeet
 *  [Sunil Bajracharya](https://wordpress.org/support/users/scottbadger/)
 * (@scottbadger)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-display-published-users-only/#post-9684235)
 * Hello, [@backpackingseries](https://wordpress.org/support/users/backpackingseries/)!
 * Hope it would all work out for you. Unfortunately, currently we do not have any
   plans to do so. May be if we get further such requests in the future we just 
   might.
 * Regards!
 *  Thread Starter [backpackingseries](https://wordpress.org/support/users/backpackingseries/)
 * (@backpackingseries)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-display-published-users-only/#post-9684379)
 * Thank you [@scottbadger](https://wordpress.org/support/users/scottbadger/)
 * On another note, I am surprised with the modest levels of installs of your plugin.
   As I have said in my [5-star review](https://wordpress.org/support/topic/a-new-benchmark-in-author-display-plugins/),
   it sets a new benchmark for author-display plugins. I sincerely wish it picks
   up soon and you get more such requests 🙂
 * Kind regards

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Shortcode to Selectively Display Published Users Only’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ultimate-author-box-lite_eceded.svg)
 * [Free Responsive Post/Article Author Section Plugin for WordPress - Ultimate Author Box Lite](https://wordpress.org/plugins/ultimate-author-box-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-author-box-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-author-box-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-author-box-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-author-box-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-author-box-lite/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [backpackingseries](https://wordpress.org/support/users/backpackingseries/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-display-published-users-only/#post-9684379)
 * Status: not resolved