Hi, I'm currently finishing up a lab website temporarily hosted here and I'm having all sorts of trouble. I've been gradually mutilating this awesome author list template to suit my own needs to produce the 'Meet the Lab' section
Originally the template used a 'foreach' loop to produce a little biog for each member of the lab, based on their wordpress profile. However, a paragraph isn't really enough for most of our lab, and the fact that the biog box on the user profile page doesn't allow paragraphs is no good.
SO, with that in mind, I'll produce child pages for each member in the lab. But Now I want to get the page content (or at least the first paragraph) for each user and reproduce it in their biog.
The problem I'm having is that the site must be dynamic enough to update with every user added without any tinkering, so simply calling page_ID is a no-no. What I want to do is choose pages that are a child of the 'Meet the lab' page, and then pull the content for each author to slot in with their biog.
This is the code I'm starting from, it's the 'description' section that I want to change.
<?php // Template Name: Authors List get_header(); ?> <div id='content' role="main"> <?php $authors = $wpdb->get_results('SELECT DISTINCT user_id FROM '.$wpdb->usermeta .' WHERE user_id<>"1"' ); if($authors): foreach($authors as $author): ?> <div class='author' id='author-<?php the_author_meta('user_login', $author->user_id); ?>'> <h1><?php the_author_meta('display_name', $author->user_id); ?></h1> <h5><?php echo the_author_meta('position', $author->user_id); ?> | <a href='<?php the_author_meta('funding_source', $author->user_id); ?>'><?php echo the_author_meta('funding', $author->user_id); ?></a> | <?php echo the_author_meta('college', $author->user_id); ?></h5> <div class='description'> <?php echo get_avatar(get_the_author_meta('user_email', $author->user_id), 150); ?> <p><?php the_author_meta('description', $author->user_id); ?></p> </div> <?php endwhile; ?> </div> <?php endforeach; endif; ?> </div> <?php get_footer(); ?>
Any suggestions? I'm sure I need to use 'get_pages' with the 'child_of' and 'author' arguments, but I just can't get it to work.
I'd really appreciate any suggestions.