2

I have seen some other questions and answers on this but unable to resolve at the moment.

I have some categories setup as follows:

Blog

-- Sub Cat

The Permalinks are currently setup with custom type: /%category%/%postname%/ and the category base is set to .

At the moment

  • If I go to a post in a subcategory it works.
  • Accessing the parent blog category works.
  • Accessing the child category does not work

I have tried changing the permalinks to the following /%category%/%subcategory%/%postname%/.

This causes the following behaviour:

  • Main Blog category access works.

  • Sub Category access works.

  • Post within subcategory does not work.

Note: The link it tries to take me to is the following:

/blog/sub-cat-name/%subcategory%/long-post-name-or-something/

1

The cause of this issue for future reference was the '.' in the category base, which was added to resolve a previous issue. Removing this and using /category/postname (per question) works, so will look for an alternative resolution to the category base issue.

1

You can change your permalinks, adding some extension at the end:

/%category%/%postname%.html
0

Solution, Permalink > Common Settings > Custom Structure

Use this slug: /%category%/

Select only sub-category for the post. There is no need to select Parent Category for a post.

  • This does not work, the permalinks to the posts then lead to the sub category instead of the post. – StuartM Nov 26 '15 at 16:38
-1

Workaround

Settings > Permalinks > Common Settings

Custom Structure /%category%/%post_id%/%postname%/

Settings > Permalinks > Optional

Category base .

Tested with WordPress version 4.8

  • This solution does not work anymore. It breaks the blog. – Jack Johansson Jul 7 '17 at 19:47
  • @JackJohansson I added which WordPress version to the answer, thanks for the suggestion. – Omar Chehab Jul 8 '17 at 6:52

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.