wp_pagenavi( array( 'query' => $wp_query ) ); change to wp_pagenavi($wp_query);
I think that $wp_query is the variable that you define! That is the thing you will need to insert! Sometimes, you will need to pass $wp_query->max_num_pages depend on your custom query request
Related Posts:
- Return only Count from a wp_query request?
- WP_Query: query posts by ids from array?
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- How to uniquely identify queries?
- pre_get_posts with get_posts
- author.php with ACF and CPTs
- Query Custom Meta Value with Increment
- Identify which loop you are hooking into; primary or secondary?
- How to make an activities stream mixing posts and comments?
- How to query for a week using key => value WP_Query argument notation?
- SQL query equivalent to WP User Query
- Finding the next 5 posts
- view queries made?
- meta_query on a date range using an array of values
- How to detect custom query inside `posts_where` hook?
- Pass the same object to multiple widgets in a template with one query
- Is temporarily overwriting $wp_query a bad idea?
- How to output different posts per page?
- What is considered a default query for the request filter?
- $wpdb insert is not work
- Pass array of taxonomy terms to wp_query
- How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?
- merge two query arguments into one WP_Query call
- Using WP_Query in “parse_query” or “pre_get_post” in Posts2Posts
- How to reduce the number of queries?
- How to query a custom post type with a taxonomy filter but display post type archive page?
- List of the years with posts presented
- Query custom post type by custom taxonomy (category slug)
- Change query_posts to WP_Query in page but does not work
- Optional Meta Query
- Set conditional on template based on referring page slug
- Editing the default wordpress search
- Iterating through $wpdb query without using get_results for large query results
- Weird orderby => post__in issue
- Slow page loads due to WordPress Core Query
- Filter posts in category archive page by year using a dropdown
- Set global $wp_query/$post variable for dynamic page generation
- Include data from custom table in WP_Query
- Meta Query relation “AND” then set array accordingly
- How to get a query variable?
- date_query seems to be ignored by wp_query
- Query Page Content From Theme Options?
- Better wordpress attachment query than this
- Modify Search Query if original Query gave no results
- Include current post into loop
- Is it possible to query from external database? [duplicate]
- Can’t sort custom post type by random
- Filter post query to only show direct children of category
- How to set up hierarchical relationships without using plugins / meta query
- wordpress udpate query not equal to
- Is it possible to retrieve posts depending on meta_key LIKE condition? [duplicate]
- WP_User_Query orderby meta_val_num
- WP_Query custom order and pagination
- Unable to paginate a custom page query
- meta_query where the meta value is not the post title
- Multi-layered WP_Query
- `offset` WP_Query argument dont work via `pre_get_posts`
- Pagination of custom page with custom fields query
- Query pages created by deleted users
- setting offset to category number in archive page
- Woocommerce Get Orders By Meta Value
- Exclude post from wp_query based on custom field boolean
- Get posts that match defined arrays of tags
- Move some posts to end of sort order, even if there is a sort in the wp_Query already
- Order posts by tags count?
- Query Posts | Combining multiple form inputs into query arguments to generate one filter result
- Strange results from WP_Query
- Is there a way to control both Order By and Order query parameters from one input field
- I need query_posts() to order results first by a meta value and then by post ID
- return child post if available otherwise parent post
- Search has query that will return no results
- Is my code correct?
- WP Query – Search in title or author_name
- URL to Post Archive of Custom Query
- Meta query doesn’t remove placeholder escape before query
- How can I modify standard search query to include also ACF custom fields values?
- orderby in WP_QUERY – Use the order from the Dashboard
- Random posts in WP_Query when searching by tag
- Ordering Posts by parent category, name ascending
- WP_Query always returning the last custom post
- How to get query results for the next page
- How to query post into a complex slider
- Loop through multiple custom fields with increasing number
- Combine privileged users array with my current query
- Horizontally paginate through sets of blog posts?
- How to organize a WP_Query’s list of posts by category and display category title?
- Need help setting up a search form for wordpress [duplicate]
- WordPress Query showing multiple titles
- custom query to get posts
- confirm my booking with phone number
- Get WP_Query query after execution?
- shortcode using multiple WP_Query’s with multiple category names not fully functional
- WordPress query very slow on +/- 300k DB entries and 7 INNER JOIN
- A Depth Like Parameter For “get_posts”
- Search query alteration not working for meta values
- Search results stuck on page 1
- Advanced Search – Is this possible?
- Block Editor – WordPress 6.1 – CPT Archive Issue – While the title changes in the loop, all records display the same data
- Multiple queries and pagination
- query loop “inherit query from template” prevents setting sort order