WP_Query docs gives a warning about the offset parameter: Setting the offset parameter overrides/ignores the paged parameter and breaks pagination.
Try something like this:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$newsArticles = new WP_Query(array(
'posts_per_page' => 16,
'post_type'=> 'news',
'paged' => $paged,
));
while( $newsArticles->have_posts()){
$newsArticles->the_post(); ?>
// HTML
<?php } ?>
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $newsArticles->max_num_pages
) );
See more examples of paginate_links here:
Related Posts:
- pagination not working for category.php (custom post types in categories)
- Custom post type pagination error
- Fourth page of custom post type archive page does not exist
- Pagination not working with custom loop
- Have different number of posts on first page
- How do you get the count of posts in an archive page?
- wp_pagenavi() with custom wp_query()?
- Custom Post Type Pagination Not Working On Archive Page
- Archive page…limiting posts per page
- Related posts by author pagination not working on the production site
- Secondary loop pagination on custom post type single post gets redirected to first page
- Pagination go to first page if i’m on last post
- Custom wp_query pagination – next_posts_link() or wp_pagenavi() always empty
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- custom post type paging not working past page 3
- WP_Query post at custom position
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- WP_Query pagination using only numbers instead of /page/1 on URL
- exclude custom post type by meta key in wp_query
- Query for posts in 2 taxonomies
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- Impossible to get Attachments Outside WordPress?
- Unable to get post content from custom post type loop
- Help Structuring Query for Archive Pages
- Remove duplicated values from a loop
- Custom Post Type Loop within Shortcode
- How to connect two custom post types with nested loops
- Pagination on category page with custom post types
- Query custom post type in the loop
- How to add pagination to wp_query [duplicate]
- Very Slow Page – How to Optimize # of Queries?
- Display CPT posts based on specific taxonomy
- Show one item per category of a custom post type
- Pagination on with query_posts in custom post type template
- WP Query with categories only shows one post and ignores the category
- Pagination issue on category.php using custom post type query
- Problem: wp_query outputs all images on site
- Custom Theme With Custom Loops
- Custom Post Types strange pagination problem
- can these 3 queries be re-written as 1 query?
- Wrapping x posts in html without leaving empty html
- Sort posts in loop by the WooCommerce Membership of the author
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- Stomping WP_Query in author archive to facilitate pagination with custom queries
- Pagination not working on custom query on a page
- display posts of custom post type with custom taxonomy
- Custom post type and custom taxonomy 404 on page 2
- Pagination for search results of custom post type [duplicate]
- foreach loop inside the loop creating duplicates in output
- All blog posts are not showing up
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Cant’ Display Custom Post Type Title Base on Tax Terms
- How do I list a custom field and custom taxonomies for each result in a loop?
- Custom Post Type Query W/Category Dropdown
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Page that lists publications by classifying them by taxonomy
- Pagination in custom post type archive.php not working
- Exclude a specific post in a Custom Post Type
- Pin posts to top of custom loop
- Pagination not working in custom post type. Help
- Filtering posts based on three taxonomies
- Numeric pagination custom post type
- Problems in paginate_links with custom query loop and MB-Relationships
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- WordPress doesn’t respect Page slug in custom post type url pagination. Keeps getting removed
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- sorting in wp query based on custom field value
- Custom post Query and WordPress Post Query Clash
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- Only show current category post
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Error in WP Query. If variable is empty it is displaying previous post value
- get_post_meta for Custom Post Type ( CPT )
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- Is it possible to add query parameters on the archive page?
- Pagination in custom post type page template
- query and paginate multiple post types
- Custom post type archive pagination with HTML5Blank theme?
- How can I pull information from my loop and divide them seperately?
- Pagination not working with custom loop
- Fallback if statement based on the number filtered from it
- Paged within a custom content type template [duplicate]
- Pagination not working with custom loop
- next_posts_link returns same content of 1st page
- Pagination not working with custom loop
- Custom loop won’t work, can’t find problem
- send user to first page of results when reposting to page?
- Pagination broke after updateto WordPress 3.4 [duplicate]
- Catergory args causing loop not to show
- How to exclude certain portfolios from a loop
- Unable to display paging navigation with a custom post type loop
- How to insert a post from a different post type after every nth post
- Complex Custom Loop with Includes