Category on refresh
-
Hey Armin,
For this site, it has a parent category (called Library) and two ‘sub‘ categories attached to it (Reading List and Podcast Series).
The permalinks have been styled as I would like them to be (parent category > category > post (where applicable)…
https://embodied-knowledge.org/library/reading-list/
https://embodied-knowledge.org/library/podcast-series/I added a period (.) in the category base to prevent the word ‘category’ appearing in the urls.
This all works fine, however whenever the two urls above are refreshed they go back to the landing page rather than reloading the actual page.
The only fix I can find is to remove the period (.) from the category base, as the pages refresh fine when this is done. However as stated, it means the word category appears in the urls which I do not want.
Not sure if this is theme related rather than a WP issue? Any ideas or suggestions of why this might be happening?
Thanks very much!
-
Hey,
this isn't a theme issue — it's a known WordPress rewrite quirk. Using . as the category base produces clean URLs, but WordPress's rewrite rules can't reliably resolve those URLs on a direct page load / refresh, especially with nested parent/child categories. Internal navigation works because the query vars are already set; a refresh forces WP to re-parse the URL from scratch, and the . hack falls apart there.
The clean fix: revert the category base to category, then install Yoast SEO and enable SEO → Search Appearance → Taxonomies → "Strip the category base". That removes category/ from your URLs via proper rewrite rules instead of a hack, and refreshes will work correctly.
Alternatives that do the same thing: the plugins FV Top Level Categories or WP No Category Base.
Best,
Armin
For paid 1-on-1 Lay Theme Coaching, contact Audrey (audrey@cyberslayers.work) or me (info@laytheme.com).
We also code custom websites or bespoke Lay features. Drop me a line at info@laytheme.com or check out my work at arminunruh.com.
Want to support my work? paypal.me/arminunruh
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it