ID;
$user_name = get_the_author_meta('display_name', $userid);
$user_description = get_the_author_meta('description', $userid);
$avatar = get_avatar_url( $userid, array(
'size' => 450,
'default'=>'mystery',
) );
get_header();
$number_posts = 11;
$offset_posts = (isset($_GET['offset'])) ? $_GET['offset'] : 0;
$search_tags = (isset($_GET['tags'])) ? $_GET['tags'] : [];
$total_blog_posts = wp_count_posts()->publish;
if ($offset_posts < 0) {
$offset_posts = 0;
}
if (($offset_posts + 11) > $total_blog_posts) {
$args = array(
'numberposts' => $number_posts,
'offset' => $total_blog_posts - 11,
);
$offset_posts -= 11;
} else {
$args = array(
'numberposts' => $number_posts,
'offset' => $offset_posts,
);
}
$number_posts = count($posts);
?>
Мы в соц.сетях
slug; ?>
'Blog Post',
'author' => $curauth->ID,
'numberposts' => $numberposts,
'offset' => $blog_posts_offset,
);
if (!empty($terms)) {
foreach ($terms as $term) {
if(is_tag($term->slug)) {
$args['tag'] = $term->slug;
}
}
}
$blog_posts = get_posts($args);
if ($blog_posts) {
$posts_counter = 0;
foreach ($blog_posts as $blog_post) {
if ($posts_counter+1 < $numberposts) {
$post = $blog_post;
setup_postdata($post);
if($posts_counter==3){
echo get_template_part('blog-posts/blog-post-small');
echo $userid;
if($blog_posts_offset==0){
echo get_template_part('blog-posts/blog-banner');
}
}else if($posts_counter==6){
echo get_template_part('blog-posts/blog-post-large');
}else{
echo get_template_part('blog-posts/blog-post-small');
echo $userid;
}
wp_reset_postdata();
}
$posts_counter++;
}
}
?>
max_num_pages > 1) : ?>
= $numberposts):?>
Показать ещё