Jump to content
Sign in to follow this  
zouleo

Display all users using the PostAuthor template

Recommended Posts

zouleo

How can I loop through all users and call the postauthor template for each user? My current code:

		$user_search = $wpdb->get_results("SELECT ID, user_email FROM $wpdb->users");
			foreach ( $user_search as $user) {
				// call PostAuthor template
				}
	

Thank you

Share this post


Link to post
Share on other sites
Danny

Hi, Where are you adding this code ?


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
zouleo

I have a plugin that uses the add_shortcode function to call that code. So all I need (in the end) is to add the shortcode to the page/post where I want to list the authors. I would be very happy if it was possible to reuse the PostAuthor template. Is it?

Share this post


Link to post
Share on other sites
Danny

OK, well I'm not 100% but you could try replacing the PostLoop section on the Author template ( Wordpress Admin Dashboard > PageLines > Drag & Drop > Content Area > with the ContentBox section ( not active by default, go to store it activate this section ). Once you have replaced the PostLoop with the ContentBox section on the author page, go to Wordpress Admin Dashboard > PageLines > Page Options > Author and then in the ContentBox section add your shortcode. See if that works.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×