Are you maybe looking for something like this?
/**
* Outputs blog / archive pagination
*
*/
function my_pagination(){
global $wp_query;
$total_pages = $wp_query->max_num_pages;
if ($total_pages > 1):
$current_page = max(1, get_query_var('paged'));
echo paginate_links(array(
'current' => $current_page,
'total' => $total_pages,
'prev_text' => 'Prev',
'next_text' => 'Next',
'type' => 'list'
));
endif;
}
Then include it in your theme likeso
<?php if ( $family_query->have_posts() ) : ?>
<?php while ( $family_query->have_posts() ) : ?>
<?php $family_query->the_post(); ?>
<h3><?php echo esc_attr( get_the_title() ); ?></h3>
<?php endwhile; ?>
<?php my_pagination(); ?>
Related Posts:
- Where to put my code: plugin or functions.php?
- Mini-Site Strategy
- How to put custom post types on front page
- How to set a fall back template for a custom post type in a plugin?
- How to add multiple images to a custom post type single post?
- Where to put archive-{post-type}.php
- WP Query group/order by category name
- Custom Taxonomy and tax_query Issue?
- How do I create an archive page for standard posts?
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Orderby CPT custom fields not working
- How to have this permalink structure: post_type/postname/custom_inner_page
- custom comments form for custom post type
- Redirect to another page using contact form 7? [closed]
- detect your custom post type in WordPress
- Custom WP_Query doesn’t display all posts
- WP_Query with custom post type ID
- how to get this tax_query working?
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Searching post types
- filter the_content, custom post type, and wp_query
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Not Able to Add New Class To CPT Attachment Image
- Wp Meta Query does not work while simple Query Works
- Custom post category name showing empty
- How to store the third party script with HTML code in the wordpress custom input field?
- Error 404 change permalink term custom term taxonomy
- How to search through all child taxonomies using WP_Query?
- I have a random letter appearing before my content. Where to start looking for the cause?
- Having issue on Loading Meta Data From CSV to CPT
- Front End users account with lots of user Roles (not Woocommerce)
- Custom post type that lets users create a set of posts?
- call a function when insert and update a custom post type
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Error in WP Query. If variable is empty it is displaying previous post value
- Not Able to Get Custom Post Type in Single and Single-custom-post-type
- How to develop custom URL redirection
- Loop carousel slider in wordpress
- Custom post type not being pulled in widget
- Issue on Counting CPT’s Under Taxonomy Term
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- How to manage wordpress knowledge base/wiki/posts collections
- Need some hints for my own WP theme development
- Default WordPress Query for a Specific Custom Post Type URL
- Woocommerce query specific product from specific category
- How to have the right design for a custom post type without accessing themes
- Dynamic Custom Post Type Plugin
- Unable to get post content from custom post type loop
- Calculating Bayesian average for custom post type
- How to rename image at uploading on specific plugin or post-type in WordPress
- Lists Posts from CPT that match the Title of the Page
- Help with CPT template pagination
- WP-Admin edit.php & post.php slowdown after import of 10k users
- CPT posts listed by category with custom rewrite URL, please help!
- Remove parent from custom post type
- How to query different post types in specific order?
- handling csv data with a custom post type
- Page as a child of a Custom Post Type
- Help Structuring Query for Archive Pages
- Conditional to modify query results
- How do I alter the position of a Custom Post Type menu item within my plugin admin menu?
- How can I get the first 50% of all posts (within a custom post type)?
- Customize permalink when creating a post
- Generate Shortcodes by Taxonomy
- Custom Taxonomy Not Showing in Menu
- Custom Post Type | Fatal Error on register_post_type()
- Loop on front-page.php
- Set object terms not working on plugin activation
- Custom query shows custom post types in trash
- Multiple post type queries (with specific arguments for each)
- Using custom page templates with plugin [duplicate]
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Filtering by Post Meta Custom Fields – Performance
- Why is archive.php used for my page
- tax_query returning all posts instead of selective posts in WP_Query
- wp_query to find posts by year and month
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- Custom WP_Query not returning results when querying custom post type
- How to add extra input fields to CPT’s comment form?
- WP Query—Relationship between two custom post types and their fields
- Get all of user’s custom post types in WP Admin for plugin
- How to dynamically attach pictures to a carousel
- Is it possible to apply a meta_query to one specific post type in a query with multilple post types?
- Remove duplicated values from a loop
- Unable to get paginate_links working with a custom query [duplicate]
- Get custom posts with certain ids in a custom loop using a shortcode
- Querying Term Posts in Loop
- Issue with pre_get_posts on custom post type archive pages
- Custom Post Type Navigation on Custom Field
- How to use WP_Query in a CPT achive page?
- WP_Query returns no results
- Use get_post_types to query only custom posts types
- Finding posts containing matching array elements in a meta field usign WP_Query
- WordPress Orderby Numeric Value Not Working
- Custom Post Type Loop within Shortcode
- Fetch taxonomies by custom post type id array
- Plugin translation not working apart from name and description