You need to add your query variable to the global used on the function, in that case “$wp_query“, just like that:
<?php
$yourQuery_args = ['posts_per_page' => '7',];
$yourQuery = new WP_Query( $yourQuery_args );
$wp_query = $yourQuery;
get_template_part('pagination');
?>
Related Posts:
- Modify previous and next text from pagination links
- Rewriting search and pagination base
- WooCommerce – Customer Order History Pagination
- Getting rid of role=”navigation” in the Home Page Pagination
- Search not showing all results
- Custom Pagination is Broken
- Pagination on Custom Post
- Prev/Next Links Broken on Static Front Page Pagination
- Custom query vars filters problem with pagination
- How to add PHP pagination to wordpress
- Pagination Not Working (pages duplicating content)
- Pagination 404 error(I have refreshed the permalinks and tried several previous options)
- How can I get my pagination loop to display the correct number of total pages?
- How to fix blank pagination links?
- /page/2/ redirect to 404
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- Mega Menu Walker
- Autoloading in Child Theme
- How to add a class to the attachment images
- How to call a function only once (global variable scope)
- How to correct schedule my event weekly with wp_schedule_event()
- Execute a shortcode when clicking on a image
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- Pagenavi pagination via wp-query in functions.php showing same content for each page
- Change logo based on incoming domain
- Count the number of times the search form template gets included on a page
- PHP code inside shortcodes
- How do I display a user’s previous orders as a select box option on a product?
- Remove meta description on certain pages
- Image media upload metabox
- How to combine wordpress_logged_in cookies in one cookie?
- Two Different Links for Same Product – WooCommerce [closed]
- Woocommerce related product text
- esc_html_e() is not translating string in wordpress [closed]
- How to show all pages in blog navigation?
- Limit 1 global comment per minute
- Modify custom field input data before creating a new post
- Remove echo from shortcode
- Is there a way to conditionally check whether a WordPress post title is empty?
- Copyright info change – Corporate Plus Theme PHP [closed]
- Inject class in body when particular page template is used
- Echo a function inside a function
- Use WordPress function in php file
- Get my site session in wordpress?
- wp_force_remove_style’ not found
- is_user_logged_in() not working in AJAX validation call
- Register a menu – Error Header
- how to save checkbox data for custom setting?
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- How to create a field in customize and show that in header.php?
- Enqueing External JS on the remote server JS
- iframe not showing in content on blog page
- Get user custom field value on function.php
- Get the name of menu item with wp_nav_menu
- How to add aria role and schema markup to custom walker container
- PHP Output also in Child theme, but different
- Dynamically Generate Functions and Hooks
- Remove submenu item from list
- Customize field names in backend profile edit page through function.php [duplicate]
- Insert content into head tag with function
- Pagination in single.php
- Getting text from custom field from customizer
- Time Delay a URL Redirect for Specific Page
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Need help for some PHP code
- Execute function only for specific user roles
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Wp_Schedule_Event every few minutes doesn’t work
- File from parent theme imported to child theme doesn’t work – any ideas?
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- static page pagination not working
- register_block_type is not working properly
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- AJAX numerical pagination problem in TwentyFifteen-child theme
- cURL needing to loop through all “next_page”
- How to center all text body in single.php at once?
- Access WP files on “server 1”, from “server 2” – using wp-load on an external website
- Get posts by id using shortcode
- Is it possible to replace ‘attachment’ with another word?
- How to include a function in a template with template tag
- wordpress all post filter by year
- Show post/page into div using function
- PHP get_category() function redeclared
- How to trim content AND retain HTML?
- Pulling a variable into the wp_nav_menu function
- Popular Post Not Show
- WordPress – registering sidebar and adding a button directly after .textwidget
- WordPress adding in site URL to header links
- Error on Include php:/usr/share/pear
- Pagination in category.php not functioning
- Shortcode to include PHP file, pass various parameters to include?
- Why can’t I include echo inside a variable? [closed]
- What does this if-statement do?: if($pages=’ ‘) {}
- Assign new post author IF another user in custom field on post transition
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- How do I change the Go To Categories link in the term_updated_messages
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- a problem in class in class-wp-hook.php
- change title of page dynamically