How can I add a custom field to an array? To complicate matters, custom field is on the Author's page, not on a regular post. It's added via Advanced Custom Fields. Typically, that field value would be called with <?php the_field(author_status); ?>
.
Here's the full code I'm working with right now.
<?php
//displays all users with their avatar and their posts (titles)
$blogusers = get_users_of_blog();
if ($blogusers) {
foreach ($blogusers as $bloguser) {
echo '<div class="content-slider-body">';
$user = get_userdata($bloguser->user_id);
echo '<div class="grid col-140">' . get_avatar( $user->ID, 128 ) . '</div>';
$args=array(
'author' => $user->ID,
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 1,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
//echo 'List of Posts for ' . user->user_firstname . ' ' . $user->user_lastname;
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class="grid col-460 fit"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
<!--post-meta-->
<div class="post-data"><span class="date"><?php the_time('F jS, Y') ?></span> by <?php the_author_posts_link(); ?>
<?php if ( comments_open() ) : ?>
<span class="comments-link">
<?php comments_popup_link(__('Leave a Comment ↓', 'responsive'), __('1 Comment ↓', 'responsive'), __('% Comments ↓', 'responsive')); ?>
</span>
<?php endif; ?>
</div>
<br /><?php the_excerpt(); ?></div>
<?php echo '<span class="rsTmb">' . $user->user_firstname . ' ' . $user->user_lastname . '</span></div>'; ?>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
}
}
?>
OMG, I got it to work! Placed this where I need it in the repeatable area:
<?php the_author_meta( 'author_status', $user->ID ); ?>