0

I've started a work for a client, to improve his website. When I wanted to customize the blog I saw that the custom permalink never showed "blog" in the url but it showed %postname%. The client wants to appear "blog/year/month/postname".

There is a CPT that in the register there is a slug that has a add_rewrite_rule:

add_rewrite_rule(
        '^cpt/categories/([^/]*)(/page/([0-9]+)?)?/?$',
        'index.php?product_category=$matches[1]&paged=$matches[3]',
        'top'
    );

Every time I try to change the custom permalink it only changes the cpt's url structure and not the others.

I've already tried this suggestion Custom permalink structure: /%custom-post-type%/%custom-taxonomy%/%post-name%/ but I've not been able to get it to work. What do you suppose I'm doing wrong?

Community
  • 1
  • 1
FilT
  • 192
  • 4
  • 13
  • So are you saying that the 'blog' is actually made up of custom post types instead of just normal, default, Posts? It would seem to me you'd just be able to go into your Settings > Permalinks page in admin, select the "Custom Structure" option and use this: `blog/%year%/%monthnum%/%postname%/` – Greg Burkett Mar 05 '17 at 23:14
  • No, there is the blog with regular posts and then there is a cpt with posts where the url structure can't have "blog" on it. When I change the structure in the permalink settings it changes for the cpt as well, giving a 404 error because of the "blog" part – FilT Mar 06 '17 at 10:18

0 Answers0