Created
January 3, 2012 02:21
-
-
Save billerickson/1553143 to your computer and use it in GitHub Desktop.
Author template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Authors | |
* | |
* @package BE Genesis Child | |
* @author Bill Erickson <bill@billerickson.net> | |
* @copyright Copyright (c) 2011, Bill Erickson | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
* | |
*/ | |
add_action( 'genesis_after_post_content', 'be_list_authors' ); | |
/** | |
* List Authors | |
* @author Bill Erickson | |
*/ | |
function be_list_authors() { | |
$args = array( | |
'orderby' => 'display_name', | |
'meta_query' => array( | |
array( | |
'key' => 'meal', | |
'value' => '1', | |
'compare' => '>' | |
) | |
) | |
); | |
$wp_user_query = new WP_User_Query( $args ); | |
$authors = $wp_user_query->get_results(); | |
if ( !empty( $authors ) ) { | |
foreach( $authors as $author ) { | |
// This shows you what data you have to work with | |
print_r( $author ); | |
} | |
} | |
wp_reset_query(); | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment