コード例 #1
0
function show_experts()
{
    $number = 100;
    $roles = 'author';
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $offset = ($paged - 1) * $number;
    $users = get_users();
    $query = get_users('&offset=' . $offset . '&number=' . $number . '&role=' . $roles);
    $total_users = count($users);
    $total_query = count($query);
    $total_pages = intval($total_users / $number) + 1;
    foreach ($query as $q) {
        $author_id = $q->ID;
        $author_url = get_author_posts_url($q->ID);
        ?>
  <div class="author-info">
  <a class="news-link" href="<?php 
        echo $author_url;
        ?>
"> 
    <div class="avatar" style="background: url('<?php 
        echo author_img($author_id);
        ?>
'); background-position:50%;"><span class="more_news_img"></span></div>
    <div class="author-heading"><?php 
        the_author_meta('display_name', $author_id);
        ?>
</div>
    <div class="author-title"><?php 
        the_author_meta('author-post', $author_id);
        ?>
</div>    
  </a>
  </div>  
<?php 
    }
}
コード例 #2
0
if ($wp_query->have_posts()) {
    ?>

				<?php 
    while ($wp_query->have_posts()) {
        $wp_query->the_post();
        $avtor = get_the_author_meta('ID', $post->post_author);
        $user = get_userdata($avtor);
        ?>
				<div class="row">
					<div class="blog <?php 
        php;
        ?>
 col-md-12 col-lg-12 col-sm-12 col-xs-12">
					<div class="img_wrapper"><img src="<?php 
        echo author_img($avtor);
        ?>
" alt="<?php 
        echo $user->user_firstname . ' ' . $user->user_lastname;
        ?>
 " /></div>
					<span class="day"><?php 
        the_time('d.m.y');
        ?>
</span>
					<h3><a href="<?php 
        the_permalink();
        ?>
"> <?php 
        the_title();
        ?>
コード例 #3
0
				<div class="day"><?php 
        if ($category[0]->cat_ID != '16') {
            the_time('d.m.y');
        }
        ?>
&nbsp;</div>
				
				<?php 
        if ($category[0]->cat_ID == '16') {
            $avtor = get_the_author_meta('ID', $post->post_author);
            $user = get_userdata($avtor);
            $author_posts_url = get_author_posts_url($user->ID);
            ?>
				 <div class="img_wrapper">
	                <img src="<?php 
            echo author_img($user->ID) . '" alt="' . $user->user_firstname . ' ' . $user->user_lastname;
            ?>
" />
	             </div>
	              <h3><?php 
            the_title();
            ?>
</h3>
	             <span class="day"><?php 
            the_time('d.m.y');
            ?>
</span>
	             <span class="day"><?php 
            echo $user->user_firstname . ' ' . $user->user_lastname;
            ?>
</span>