My website is hosted in Godaddy and they have their own server cache. The problem I am having is that when I go to the second page (/page/2/ or /page/3/) the content is from many days ago. The solution, according to Godaddy, is to add the parameter ?nocache=1 at the end of the page (for example /page/2/?nocache=1).
My question is, how could I add that query string only to the pagination of the template? I wouldn’t like all the pages to have that query string, only the pages that contain /page/ in the homepage and the different categories. Is this even possible? Thank you.
Not really theme related since pagination usually managed by WordPress.
The reason “page 2” shows older content, is that most indexes are in reverse date order by default in WordPress. Meaning if you have 10 items per page, then page one has newest posts, page 2 has 10 posts older than that, page 3 has 10 posts older than that, etc.
Probably a function you could add, but you might need to scour the web for how to do that, as nothing the theme actually manages; more of a permalinks, slug, URL matter.
Sorry, don’t have easy answer on this one. You’d think GoDaddy would have answer since this is WordPress specific, not theme specific — you’d have this same issue with ALL WordPress sites, regardless of theme used.
Ok I see… Under the setting “Pagination Style” I have selected the option “normal pagination”, so at the bottom of the home page I have the links “1 2 3″… etc. that send the visitor to /page/2/ or /page/3/ and so on.
Would it be possible to append the query string “?nocache=1” directly after those links in the template? Or is that also completely managed by WordPress? Sorry if the question seems repetitive, it’s just that this is the solution Godaddy gave me…
Hi
You can use this function to add a query string to wp url: https://developer.wordpress.org/reference/functions/add_query_arg/ but you will need a custom implementation in this regard. Unfortunately we can’t provide customization services for the moment so if you can’t manage to solve this my advice is to look for someone who can help you with implementation or hire a developer to do it for you.
Thanks for your understanding!