Firstly my problem was the %tag% in the permalink, but I resolved it with this patch:
%tag% in permalink not working

So my custom structure now looks like this:


And the url is like:


However, now I have something else that I can't resolve. When post doesn't have any tag the url becomes:


.. which is undesired.

If post does'nt have tags, i would like the url to be..


and if it does..


Anyone have an idea how to solve this?


I don't think there is an easy way to solve this, because /some-category/some-tag/ will be used as an overview page for all posts in category some-category and with tag some-tag. If an URL like /cocktails/bloody-mary/ comes in for a post with the name bloody-mary, category cocktails and no tags, WordPress can't split it up correctly because at that time it does not know that bloody-mary is not a tag, and should thus be a post name.

The best solution is to use a fixed string when there is no tag (untagged, like uncategorized is what I used in my answer to your related question).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy