How to make pagination with wp_query?

0 like 0 dislike
17 views
Good time of day. Please tell me how to get pagination to attach ?

<?php/*Template Name: Шаблон блогов*/get_header(); ?>Follow the world of designTo the Council<?php $wpb_all_query = new WP_Query(array('post_type'=>'post', 'post_status'=>'publish', 'posts_per_page'=>1)); ?> <?php if ( $wpb_all_query->have_posts() ) : ?> <?php while ( $wpb_all_query->have_posts() ) : $wpb_all_query->the_post(); ?> <!-- <a href="<?php the_permalink(); ?>">--><?php the_title(); ?><?php the_date('d.m.Y'); ?><?phpthe_post_thumbnail('full', array('class' => 'miniature5')); ?> <?php mayak_announcement('mayak_segment_length','mayak_segment_more'); ?>Read more<!-- </a> --><?php endwhile; ?><!-- end of the loop --><?php wp_reset_postdata(); ?><?php else : ?><?php _e( 'Извините, нет записей, соответствуюших Вашему запросу.' ); ?><?php endif; ?><?php if (function_exists("emm_paginate")) {emm_paginate();} ?>Other entries<?php $posts = get_posts('orderby=rand&numberposts=6');foreach($posts as $post) { ?>
<?phpthe_post_thumbnail('medium', array('class' => 'miniature2')); ?> <?php the_title(); ?>
<?php}?><?php get_sidebar(); ?><?phpget_footer();?>
by | 17 views

1 Answer

0 like 0 dislike
A difficult question is when Google did not help. And here it is helps. To the constructor of WP_Query, you need to pass a parameter posts_per_page the number of posts per page or the option is paged, the page number that you want to get your own.
by

Related questions

0 like 0 dislike
1 answer
asked May 21, 2019 by HarviSpecter
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
33,949 users