B2主题优化 WordPress标签HTML伪静态教程

B2主题优化 WordPress标签HTML伪静态教程

WordPress标签HTML化,代码如下,添加到functions执行代码:


// html链接化
function html_url_rules() {
global $wp_rewrite;
$wp_rewrite->page_structure = $wp_rewrite->root . 'page/%pagename%.html';
$wp_rewrite->extra_permastructs['post_tag']['struct'] = $wp_rewrite->root . 'tag/%post_tag%.html';
}
add_action( 'init', 'html_url_rules' );
// 页面链接添加html后缀
add_action('init', 'html_page_permalink', -1);
function html_page_permalink() {
    global $wp_rewrite;
    if ( !strpos($wp_rewrite->get_page_permastruct(), '.html')){
        $wp_rewrite->page_structure = $wp_rewrite->page_structure . '.html';
    }
}
WordPress教程

WordPress实现未登录时图片模糊显示

2021-5-19 2:10:31

WordPress教程

WordPress文本模式下用pre标签显示html代码

2021-5-19 4:09:43

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索