Custom Author Listing
-
Hello, I am trying to create a page that lists all users with the role author with first name, last name, local avatar plus an image of a custom post type ‘project’ (x 2 posts) and a link to the authors page.
I have a custom page template set up, and the first name / last name and avatar working, but the link returned isn’t the full link to the users page and there are no images from the posts being returned.
I am using this code: http://pastebin.com/17S5Jy8H
I have a feeling there’s something wrong with my query, but don’t know where I am going wrong. This drove me nuts last night and I don’t have much time to get it finished (it’s for my uni’s degree show – I am a student and said I’d build the site!)
Would appreciate any help… thanks in advance!
-
WordPress 3.3.2 BTW
UPDATE:
After finding this: http://www.mattvarone.com/wordpress/list-users-with-wp_user_query/ I am getting somewhere. Have the first part working correctly, but still problems getting the custom posts.
Didn’t mean to mark this as revolved – still appreciate some help with the custom query!
Hi looking at the pastebin, it might be this bit!
get_author_posts_url( $author_info->ID )Try:
get_author_posts_url( $author->ID )HTH
David
Hi David, thanks for your reply. That bit actually works 🙂 the author_info var is set earlier on so is all good. The problem I am having is fetching the custom posts.
I have a custom page template set up, and the first name / last name and avatar working, but the link returned isn’t the full link to the users page and there are no images from the posts being returned.
I thought it was the author posts link that was wrong, for the lmages, are you not using the Featured Image then you could use something like?
UNTESTED:
<?php if ( has_post_thumbnail() ) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute('echo=0'); ?>"> <?php the_post_thumbnail( array( 200,100 ) ); ?> </a> <?php endif; ?>HTH
David
Hi David, thanks again for your reply. I am using a plugin called Types which allows you to make custom post types without coding (take it a look it’s very good.) I have image upload fields for two images for each project and it’s very slick and easy to do – There will be over 80 users that will need to do this very quickly before our show start (14th) so it’s best I keep it simple to people that might not be familiar with WordPress!
The topic ‘Custom Author Listing’ is closed to new replies.