I am looking for a way to return something like the following:
- User, email, post title, post status
- User, email, post title, post status
- repeated….
Each user on my site has only 1 post. It is a custom post type called Company Listing.
I am looking for a way to return something like the following:
Each user on my site has only 1 post. It is a custom post type called Company Listing.
You must be logged in to post a comment.
You can do that with a simple loop assuming that the users are also the authors of the post,
create a template page, and copy the inside of your page.php to it.
then replace the loop part with this code:
and add this little code css to style it right:
now you didn’t specify what is “USER” so i just showed you how to use user_nicename but after this line
$user_info = get_userdata($post->post_author);
you can use $user_info with:and a few more.
As for status i assume you are talking about the post_status so you will need to add
'post_status' => array('publish','pending','draft','future','private',....)
to your $args.and if you are talking about a custom filed then just call that field with
get_post_meta($post->ID,'status_field_name',true);
Hope this helps