0

I have a website and in my localhost I can access page pagination through query_vars. However, when I upload this site to my server, it does not recognize query_vars and simply removes it from the URL.

For example:

http://website.com/programacao/page/1 becomes http://website.com/programacao/

But on the localhost:

http://locahost/programacao/page/1 remains http://locahost/programacao/page/1

And I'd like to know the reason for that. I've already tried setting up RewriteRules in .htaccess and functions.php but nothing happens.

Thanks for the help.

aleDsz

  • What is programacao? Note that if your permalink structure has a trailing slash, all URLs must have a trailing slash- page/1 should be page/1/. – Milo May 29 '17 at 17:05
  • programacao is the permalink of my page. I've already used with /page/1/ but anyway, on the server, it does not work at all. – aleDsz May 29 '17 at 17:15
0

SOLUTION

My solution was change to use http://website.com/page-name/page/1/ and http://website.com/page-name/page/2/. And when I get query_var, I decrease it and check if it is less than zero, I return it to zero.

I had to use this solution because when I pass /page/1/ or when I do not pass anything, my paged returns me a zero value, and when I pass /page/2/, it returns me 2.

So, decrement to be in the exact position of my array and pagination through the ACF is executed successfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.