Jump to content

Вывод авторов и под ним два последних его поста Wordpress


Recommended Posts

Всем привет!
Подскажите пожалуйста как сделать вывод авторов, которые постят в определенной категории и под ним два последних его поста, что бы также работала постраничная навигация.

Сейчас код выглядит так, но он не правильно работает.

<div class="article related-post autors-block">
<?php
global $authordata, $post;
$authorID = $authordata->ID;
$autors_block_query = new WP_Query();
$autors_block_query->query('cat=264&autor='.$authorID.'&post_type=post&showposts=2&paged='.$paged);
?>
<h3>Авторские колонки
<span class="pagination-ajax">
<?php previous_posts_link('<i class="fa fa-angle-left"></i>') ?>
<?php next_posts_link('<i class="fa fa-angle-right"></i>', $autors_block_query->max_num_pages) ?>
</span>
</h3>

<?php endwhile; ?>

<?php while ($autors_block_query->have_posts()) : $autors_block_query->the_post(); ?>


<div>
<div class="author-info">
<div class="author-image">
<img src='<?php $authorImage = get_the_author_meta('image', get_query_var('author') ); echo $authorImage; ?>' />
</div>
<div class="author-right">
<?php
$expert = get_the_author_meta( 'expert' );
if($expert) {
echo '<div class="author-expert">'.$expert.'</div>';
}
?>
<div class="author-name"><?php echo get_the_author_meta('user_firstname'); ?> <?php echo get_the_author_meta('user_lastname'); ?></div>
<div class="author-descr"><?php echo get_the_author_meta('description'); ?></div>
</div>
</div>
<?php
$author_posts_query = new WP_Query();
$author_posts_query->query('post_type=post&post_status=publish&showposts=2');
while ($author_posts_query->have_posts()) : $author_posts_query->the_post(); ?>
<div class="author-posts">
<h2>"><?php trim_title_chars(42, '...'); ?></h2>
<?php cmski_post_meta (); ?>
</div>
<?php endwhile; ?>
</div>
</div> 

Буду очень признателен за любую подсказку, могу отблагодарить WM или ЯД, заранее благодарен!

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...