add_rewrite_rule on default post type

This would be bad practice, since WordPress already has a functionality to do this built in. Rewriting the built in functionality is never a good idea.

To achieve this the best way is to use Taxonomies.

Lets say you create two categories:

  1. Foo
  2. Bar

Now select the categories for the post in question and setup your permalinks structure to be /%category%/%postname%/ and you will get:

  • foo/post-name
  • bar/post-name

Hope this helps.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)