我已经开始为客户工作,以改善他的网站 . 当我想自定义博客时,我看到自定义固定链接从未在网址中显示“博客”,但它显示%postname% . 客户想要出现“博客/年/月/邮政名称” .

寄存器中有一个CPT,它有一个带有add_rewrite_rule的slug:

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

每次我尝试更改自定义永久链接时,它只会更改cpt的url结构而不会更改其他结构 .

我已经尝试了这个建议Custom permalink structure: /%custom-post-type%/%custom-taxonomy%/%post-name%/但是我做错了吗?