一、给页面、标签的url添加html后缀
1、在function.php里面添加如下代码
/* 自定义tag、page页面url
/* ******************************************** */
function custom_page_rules() {
global $wp_rewrite;
/** page页面自定义URL样式 **/
$wp_rewrite->page_structure = $wp_rewrite->root . 'post/%pagename%.html';
/** tag页面自定义URL样式 **/
$wp_rewrite->extra_permastructs['post_tag']['with_front'] = '';
$wp_rewrite->extra_permastructs['post_tag']['struct'] = $wp_rewrite->extra_permastructs['post_tag']['with_front'] . 'tag/%post_tag%.html';
}
add_action( 'init', 'custom_page_rules' );
2、将function.php重新上传到服务器上,一定要到后台的设置里面将permalink重新保存一下,不然会出现404页面
二、给文章的url添加后缀:

三、分类的链接如/category/dyeing-machine,去掉category的方法

四、自定义类型的文章的url添加后缀:
首先安装Custom Post Type Permalinks插件
