• I've set default post category in WP Writing - settings to "news"
  • Added a couple post categories like "blog" and "event"
  • Added a couple posts in "news" , "blog" and "event" categories and each time selected appropriate checkbox for category.
    • Changed permalink for posts to be /%category%/%postname%/

Permalink when I edit my "blog" post reads "blog/posttitlehere" but when I print out the permalink with get_permalink($postid) it has already been changed to "news/posttitlehere"

(Unwanted) result: Whatever I do, all posts (no matter it being blog-posts or event-posts) , they all have "news/posttitlehere" as the url. So each time and for all posts the actual category is replaced by "news" , the default post category.

Even on the post archive pages. Say I go to sitename.com/blog I get a list of all blog items and their "read more" links all point to "news/posttitlehere"

Anyone has a clue how to make this to become "blog/posttitlehere" or is the only way to do this through CPT ? I would think setting %category%/%postname% in settings would be enough.

  • How would WordPress know which category you would prefer in the permalink? It just chooses the one with the lowest ID when they are in multiple categories. The default category isn't a special category, it's a %category% like all the other ones. – Milo Jun 1 '17 at 15:20
  • thanks @Milo I create a new post and set it to "blog" category (only "blog", no others). When I doublecheck the post the permalink reads "blog/posttitlename". But on the website that "blog" gets replaced with "news". Even if I browse to that page directly by typing the url – Wayfarer Jun 1 '17 at 15:26
  • That sounds like a possible theme issue. What theme are you using? Can you switch to one of the default themes to see if the issue persists? – Milo Jun 1 '17 at 16:20

Your Answer

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

Browse other questions tagged or ask your own question.