• I am having problems with a site that uses the category “vacatures” for posts. The “Vacatures” page, lists those posts. Some time ago the client has made a page called “Vacatures” and replaced the old “Vacatures” posts page with his new “vacatures” page. The page is a main-page, and has children (sub-pages) like vacatures-bouw, vacatures-civiel etc.

    Now we want the old page back, so the posts page with the “vacatures” posts. I changed the menu, so that it links again to /category/vacatures/


    But if you click the menu, the site tries to go to the clients “vacatures” page (the page). I deleted that page, but now, on clicking the link, you end up on vacatures-bouw, a sub-page of the old vacatures page.

    If I type https://mysite/category/vacatures/ in the address bar, I get a “page not found error”
    If I go in the dashboard, and go to Posts>Categories >Vacatures> View I go to the vacatures-bouw page.

    I understand that in WP,you cannot use the same term for a category and a page/slug. Makes sense. But now that it has been done, I need to get this working again. Any ideas how to solve this?

    Thanks

    • This topic was modified 1 year, 1 month ago by eagerbob.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Something more is going on here, /vacatures/ !== /category/vacatures/
    WP should be able to distinguish between the two. I have a similar situation on my site without any issues like you’ve described.

    Are you sure the category term “vacatures” actually exists?

    You should try deactivating all plugins and switching to a default Twenty* theme. Also visit the Permalinks Settings screen. No need to save or change anything. Loading the page causes the rewrite rules to be regenerated. You should now be able to get the the vacatures category archive page.

    Restore your normal theme and plugins, one at a time, verifying the category request continues to work after each. If it again fails, the issue is within the last activated module.

    If all else fails, getting the wrong response is because the query vars are not as they should be. The “request” filter could be used to correct anything that WP comes up with that is improper. For example, if WP comes up with 'pagename'=>'vacature', you could unset that and set 'category_name'=>'vacature' instead.

    Thread Starter eagerbob

    (@eagerbob)

    You should try deactivating all plugins and switching to a default Twenty* theme.

    OK found it. It was a plugin “redirection” that had been installed by someone at the client. Never noticed it because it was not something I expect anyone to do.

    Lesson is to *never* give admin rights to clients managing their own sites when it is not absolutely necessary. Which it almost never is…

    Thanks!

    • This reply was modified 1 year, 1 month ago by eagerbob.
    Moderator bcworkz

    (@bcworkz)

    You’re welcome! An important lesson indeed. FWIW, I usually give clients a custom role that’s more or less equivalent to “editor”. I use a role name such as “site-manager” which sounds important and powerful but is in fact a restricted role ??

    There are role and capability plugins which make doing this fairly simple. Since roles and capabilities are persistent, you generally don’t need the plugin active or even installed for the roles to continue to work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Same term for category and slug’ is closed to new replies.