Complete the code to get the current page number for pagination.
$paged = (get_query_var('[1]')) ? get_query_var('paged') : 1;
The correct query variable to get the current page number in WordPress pagination is paged.
Complete the code to set the number of posts per page in the custom query.
$args = array('post_type' => 'post', 'posts_per_page' => [1], 'paged' => $paged);
The posts_per_page parameter expects an integer number of posts per page, like 10.
Fix the error in the code to properly create a new WP_Query object.
$custom_query = new WP_Query([1]);The WP_Query constructor requires a variable with the query arguments, which is $args in this case.
Fill both blanks to correctly display pagination links for the custom query.
echo paginate_links(array('total' => [1]->max_num_pages, 'current' => [2]));
The total parameter needs the max number of pages from the custom query object, and current is the current page number.
Fill all three blanks to reset the post data after the custom query loop.
if ([1]->have_posts()) { while ([2]->have_posts()) { [3]->the_post(); // Your loop code here } wp_reset_postdata(); }
Use the same custom query object $custom_query to check posts and set up post data in the loop.