Your navigation function seems to take data from main query (global $wp_query
) variable.
However what you have on custom page is a completely separate query (new WP_Query()
), which doesn’t modify main one (as it shouldn’t).
The best way would probably be to modify your pagination function to optionally accept custom query object as argument to be used instead of main one.
Related Posts:
- What is This esc_html_e() i wordpress php?
- Build a content and excerpt grid loop with paging and options for # of posts
- Displaying post per day
- How to add active class to custom menu using while loop and wp_list_pages
- delete an array element when its date expires
- How can I loop into two different DIVS without repeating the DIVs
- How to speed up a wordpress function with multiple loops?
- Custom excerpt function re-factoring
- Get first URL from post content
- Show css depending on activity type in BuddyPress activity-loop [closed]
- get author_name from queried post
- Blog posts repeat
- how to refresh div on template part?
- Can’t find infinite loop cause
- Checking array against author id in loop
- Custom Pagination is Broken
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- use loop to return blog details
- How to get current post category details inside “loop”?
- Calling function in loop causes repeat data
- Strip from or something better?
- How to Add a cutsom slug to my custom author role
- Products listing check if meta checkbox is checked
- How to output the taxonomies that are assigned to each custom post?
- update_user_meta as multiple value but with same meta key
- cURL needing to loop through all “next_page”
- WordPress Ajax filter: Create two loops for different output styles?
- How can I get my pagination loop to display the correct number of total pages?
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- How fix error in the WordPress loop?
- My query keeps looping infinitely ! how to stop it?
- Retrieving specific images from Media Library
- Modify category archive page loop on functions.php
- Options.php loop won’t show!
- Loop on a wordpress Page instead of content coming from the WP text editor
- How to get the original price of the product in woocommerce?
- How to redirect users to custom lostpassword page?
- Can I write ‘RewriteCond’ using ‘functions.php’?
- How to add 2 posts under another post? Formatting should be intact
- Overriding a theme redux file in child theme
- Validate a users email address when using gmail to register
- Get widget settings function?
- What is the fastest way to load PHP functions that are only used in one theme template?
- Adding tawk.to code just before body tag on functions.php file
- allow subscribers to see private posts without plug in
- add_action shortcut?
- remove wp floating submenu in wp dashboard
- ACF: how do I get the fields and its values of a specific group?
- Get page that displays all children of taxonomy parent
- Function to capture a value and store it in a variable
- Adding a widget function into the php theme file
- My new button is in the wrong place
- How do I Turn This Into An if statement?
- Call to undefined method – Download Monitor
- How do I link a button I created in theme customizer to a function?
- How to change menu labels
- How to obtain the current website URL in my theme?
- Remove Custom Divs from AMP pages
- Read array in php?
- How to get post ID in a Page?
- Tell WP register script to load a script only when the entire page is loaded
- get_template_directory adding FTP root folders in urls
- Is it possible to display a DIV to not logged in users and then change it for users who are logged in?
- Remove extract from function
- Undefined offset: 3 in custom function
- How to pass current loop data into nested loop
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- How to make a cookie be on the whole site instead of being on a specific page/
- How to create Loop code for Menu using WordPress?
- Can/should we delete wordpress cron jobs with no action?
- Database entry removed on browser refresh, Ajax PHP jQuery
- Allow a user or role to view drafts and previews, but not other admin privileges?
- Display Visual Composer shortcode if a post belongs in specific categories
- Preventing direct access to a page in WordPress
- How to use data URL in WordPress?
- Flushing the slug base has no effect and does not change
- Multiple cron jobs vs daily cron job doing multiple things? Which one yields better performance and scalability?
- How to output values from a loop into a javascript array
- JQuery modal not loading video on popup, only displaying it after multiple reopenings
- Get user by meta data key and velue
- Logo custom width not implementing
- Woocommerce textarea format ignored
- Add another role to a user when they click a button?
- Using wordpress functions in class and change my code to OOP PHP
- Add missing alt tag to featured images for “storefront” theme
- Notice: Undefined index: post_title error
- Unable to pass arguments to function used in add_action
- What is the proper way to call a function (from functions.php) on a link click?
- Making list of posts with chosen description
- Load admin bar without wp_head or wp_footer [duplicate]
- Allow user to select location and then set cookie for location in WordPress
- Merge / Combine two php functions for Previous and Next Link with Thumbnail
- str_replace not responding in functions.php [closed]
- How to add button to top of theme customizer?
- Send foreach $_post method to contact form 7 [closed]
- Contact form with dynamic dropdown and filter
- Critical Error customiser
- Why a class property becomes empty?
- Hide category by tag
- How do I stylize selected comments?