Home › Forums › Add-ons › Repeater Field › Advanced Custom Repeater Field Page Navigation › Reply To: Advanced Custom Repeater Field Page Navigation
Hi Elliot,
Thanks for your reply, I know it isn’t a ‘regular’ wordpress query. I’m just trying to get it working like one.
I got my following code working with a custom query_var called albums: Pastebin
And I can use the url: http://mydomain.local/pagename/?albums=2
The last thing I want to achieve is a rewrite rule for the query var, but somehow that isn’t working yet. I would like an url like this: http://mydomain.local/pagename/page/2/
/* Photo albums pagination parameter */
function add_albums_query_var(){
global $wp;
$wp->add_query_var('albums');
}
/* Rewrite rules albums pagination */
function add_albums_rewrite_rule() {
add_rewrite_rule('^/page/([0-9]+)/?$', 'index.php?p=25&albums=$matches[1]', 'top');
}
add_filter('init', 'add_albums_query_var');
add_action('init', 'add_albums_rewrite_rule');
25 is the page id where the repeater field is looped.
Any idea why this isn’t working?
Thanks a lot!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.