SOLVED
with the magic of paginate_links (after the endwhile)
<?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' => $loop->max_num_pages
) ); ?>
Related Posts:
- Retrieving 3 latest post from each of 5 different custom post types
- Query for posts in 2 taxonomies
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- pagination not working for category.php (custom post types in categories)
- postsperpage value not being applied
- Custom Post Type Query W/Category Dropdown
- display news with pictures 3 small and one large (loop)
- How do I correctly query posts from a post ID?
- How to exclude certain portfolios from a loop
- Display all posts in a custom post type, grouped by a custom taxonomy
- How do you get the count of posts in an archive page?
- How to use a custom post type as front page?
- Display several random posts, but make sure a condition is met
- WP_Query to loop a Custom Field, Custom Post Types do not show
- how to group custom post type posts by custom taxonomy terms
- Using Query Posts With Multiple Post Types And A Taxonomy
- How to get the parent’s taxonomy?
- How to show posts from multiple post types in a single loop? And display them separately on the same template
- Query not returning CPT posts
- Unable to display multiple post types in same query (WPML WP_Query)
- Query Custom Post by Category
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Quickest way to get last or oldest post date – WP Query
- ‘category__and’ for custom taxonomy?
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Lists Posts from CPT that match the Title of the Page
- Loop on front-page.php
- Remove duplicated values from a loop
- How to insert content from another Custom Post type into Post?
- WP_Query | ‘post_type’ doesn’t work
- Filter by custom taxonomy slug on a custom post type
- Loop through Custom Post Type, and then show children within each iteration
- Sorting multiple custom post types without a meta key/value pair by sort order
- Change or update WordPress loop based on dropdown selection
- Can I create a loop with multiple post types and specify different $args for each post type?
- WP_Query orderby modified to include custom meta changes
- Display custom post type from dynamic custom field
- How to make sure content doesn’t display if selection is empty
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Custom loop with multiple taxonomy queries
- What’s the WP way to load remaining custom posts?
- Problem: wp_query outputs all images on site
- WP Query post__in not returning correct results
- How can I group posts by months and years?
- Multiple Custom Post Type queries, how to DRY it up
- Custon Content within WordPress Loop
- Using wp_query to modify the loop in index.php for a CPT
- 3 random images from custom post type, each in a div with a diffrent class
- Control content before and after custom post type loop
- get_pagination not working on a custom post type query (using WP_Query)
- WP_Query with custom post type ID
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Loop through posts of only 2 statuses
- Trying to add a class to post links
- Display the current post in browser as the first post in a loop (for a slideshow)
- Display post from custom post type
- List all Custom Post Type posts excluding certain Taxnomy term
- Query all post types but limit to parents
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Custom Post type showing up in loop, regular posts are not showing up
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Custom post type pagination error
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Sorting the Loop by Taxonomy Value
- Custom Query: Multiple CPTs and a taxonomy filter
- WP query_posts group by meta field related
- Page that lists publications by classifying them by taxonomy
- Custom wp-query display post only today
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Exclude a specific post in a Custom Post Type
- Pin posts to top of custom loop
- custom post type and a “sticky” position taxonomy
- Filtering posts based on three taxonomies
- Pagination Not Working When Used With WP_Query() `offset` Property
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- SEARCH QUERIES – REVERSE OUTPUT
- Error in the page of a CPT file in WordPress
- post_type incorrect for custom post type
- Staggering featured post using ‘sticky’
- subtracting the current post form then whole loop, which is generating all CPT titles
- Mix Facebook and Twitter feed into custom posts
- Query the title of the page to show posts with matching category in the loop
- Strange behavior on WP_query
- Main site single-property.php design, as homepage of a multisite
- Imported Content Doesnt Show Up On Frontend
- How To Loop Through list with Custom Post Types
- Custom Post Type + Category archive
- Loop with Custom Post Type and Taxonomies
- Post data in separate divs with incrementing class using WP_Query
- Custom post type blog pagination conflict
- Custom post-type’s pagination not working in category.php
- Query Custom Post Type by Tag
- display custom post type from register taxonomy
- Custom post type and have_posts() return empty result
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- Display ACF object field data using Elementor Custom Query
- How can I show posts with the same tag?