Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Category on refresh

Category on refresh

Scheduled Pinned Locked Moved General Discussion
3 Posts 2 Posters 29 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DLB
    wrote last edited by
    #1

    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!

    1 Reply Last reply
    0
    • arminunruhA Online
      arminunruhA Online
      arminunruh
      Global Moderator
      wrote last edited by
      #2

      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

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DLB
        wrote last edited by
        #3

        Thanks Armin!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        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:
        1. When using a WordPress Cache plugin, disable it or clear your cache.
        2. Update Lay Theme and all Lay Theme Addons
        3. Disable all Plugins
        4. 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:
        1. Post a link to where the problem is
        2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
        3. If the problem is difficult to explain, post screenshots / link to a video to explain it
        Online Users
        arminunruhA
        arminunruh
        Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
        laytheme.com
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Recent
        • Tags
        • Popular
        • Users
        • Search