try this
<?php
//global $wp_rewrite;
$loop->query_vars['paged'] > 1 ? $current = $loop->query_vars['paged'] : $current = 1;
$pagination = array(
'base' => @add_query_arg('page','%#%'),
'format' => '',
'total' => $loop->max_num_pages,
'current' => 0,
'show_all' => true,
'prev_next' => true,
'prev_text' => __('« Back'),
'next_text' => __('Newxt»'),
'type' => 'plain'
);
if( $wp_rewrite->using_permalinks() )
$pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged ' );
echo "<div class=\"pagination\" >";
echo paginate_links( $pagination );
echo "</div>";
?>
Related Posts:
- How to fix pagination for custom loops?
- Pagination not working on home page
- WordPress category & taxonomy loop with pagination
- How do I prevent one of two multiple loops from repeating on a second page?
- Two custom loops, pagination, offset
- Previous and Next Post link doesn’t work
- Pagination adding extra posts only on page 2
- multiple loops with pagination on the same page
- Enable infinite scroll on single.php [closed]
- How to paginate this custom loop? [duplicate]
- Make a custom loop inside single.php with pagination
- Why do I get `Call to a member function have_posts() on a non-object `? [closed]
- Pagination gives extra page with no results
- Get Pagination (WP-PageNavi) not to work
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- Complex query and posts pagination
- Why only one post (and no pagination) on this variation of the loop?
- Calling & display certain product category loop and pagination on the homepage
- Make blog page show 10 on first page, 9 on every other page
- Pagination for multiple loops
- How to fix pagination for custom loops?
- How can I paginate this?
- Genesis multiple category custom loop 404s after first page
- How to fix pagination for custom loops?
- How do I paginate a get_posts() request inside another page loop (Paginating childpages)
- Pagination on Single Post
- How to get my loop to paginate?
- Distribute Gallery Images Every nth in Loop
- How to exclude or filter password protected posts when using next_post_link() previous_post_link
- How to append a query string to pagination?
- How do I get my loop.php to properly paginate?
- First archive page with a few posts
- Pagination broken after using 2 loops to show content
- Pagination on custom post type on front-page.php
- I have broke my pagination, same posts on all pages (index.php)
- Frontpage pagination by week
- How can this multiple loop have pagination as described?
- Display more than 10 posts on author.php file
- static page with multiple loops breaks post pagination
- Pagination for two loops
- Skip 5 latest post while paging?
- Why does my WP_Query pagination on a custom page.php only loads the homepage?
- How to insert content before pagination in loop?
- Pagination on a underscore custom theme
- WordPress multiple loops with default pagination
- How to fix pagination for custom loops?
- Style first 3 posts differently and use a 2nd loop to get rest of posts / offset and pagination broken
- Custom loop not working in singular.php, working in other pages
- Alternative layout the loop
- How to fix pagination for custom loops?
- Adding pagination to WP_Query [duplicate]
- How to fix pagination for custom loops?
- How to fix pagination for custom loops?
- Why is my pagination showing up?
- Displaying posts limit: can’t get pagination to display [duplicate]
- Paged homepage – requirements?
- Home page loop with pagination problem
- WooCommerce custom loop pagination on front page
- posts_nav_link() not working on index.php
- Custom Page Template and Category Exclusion
- repeating posts on 2nd page to posts
- Limitless amount of posts in custom archive page
- Same posts within a paginated page
- Multiple loop with pagination in same page
- Insert multiple custom components after x-number of posts
- Counting the posts of a custom WordPress loop (WP_Query)?
- Pagination not working with custom loop
- Is there any difference between the_title() and echo get_the_title()?
- Pagination returns 404 after page 20
- is_home, and is_front_page conditional problem
- Is `query_posts` really slower than secondary query?
- WordPress Loop Through Particular Pages
- Transient pagination not working properly
- Display date only once for a each set of posts relating to that date
- Chopping up a large ajax request of around 200 posts [closed]
- Combining the_excerpt with the_content
- Custom loop with conditional statement to separate each terms
- How to display different number of posts
- Get search.php results in header.php?
- Do I need to use The Loop on pages?
- ‘Auto Draft’ Post showing in wordpress loop
- How do I display an image before the first post of the loop when I’m using get_template_part?
- Multiple get_posts() queries on one page
- Escape current post from loop
- Why isn’t my multiple loops working?
- Why the first with flexslider appears as blank on my code?
- Rendering pages
- How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()
- WP_Query is only looping home page, not pages
- How to filter posts by category INSIDE the loop
- Function the_posts_pagination() not compatible with WP_Query arguments
- Adding a second loop breaks everything
- Custom Query with Sticky Posts
- Return only one post format in index.php [duplicate]
- How to execute custom loop before loop content?
- Return only content in excerpt field in loop
- get_posts and wp_autop (remove filter)
- Trouble preventing duplicate posts between 2 loops on homepage
- Pagination not working with custom loop
- Pagination only showed when no category is set in wp_query