【问题标题】:How to Add .html to the End of a WordPress URL and hide /product-category/如何将 .html 添加到 WordPress URL 的末尾并隐藏 /product-category/
【发布时间】:2017-09-19 12:44:00
【问题描述】:

我使用 Remove Taxonomy Base Slug 插件隐藏在 url /product-category/ 例如 site.ru/product-category/cars/sport/bmw 制作 site.ru/cars/sport/bmw 该插件做得很好,但是不可能在 url .html 的末尾添加任何地方来拥有 site.ru/cars/sport/bmw.html 而不是 site.ru/product-category/cars/sport/宝马 site.ru/cars.html 而不是 site.ru/product-category/cars 在安装的永久链接的设置/%postname%.html 但是还是不行,好像是插件规则的问题

【问题讨论】:

    标签: wordpress


    【解决方案1】:

    是的,我们可以在带有.html 扩展名的URL 中隐藏和显示类别到页面中。我正在为 WordPress 的.html URL 开发一个插件。 检查插件并添加您的评论。此外,我们提供支持。 插件林Wordpress add .htmli into custom post and category list page

    示例代码:

     function jn_htmlInUrl_page_permalink() {
     global $wp_rewrite;
     if ( in_array( 'page', $this->selected_post_type ) ) {
     if ( ! strpos( $wp_rewrite->get_page_permastruct(), '.html' ) ) {
         $wp_rewrite->page_structure = $wp_rewrite->page_structure . '.html';
         }
    }
        $wp_rewrite->flush_rules();
    }
    

    如果您在此处或插件详细信息页面获取问题和评论。 我会尽力帮助解决问题

    【讨论】:

      猜你喜欢
      • 2011-01-05
      • 1970-01-01
      • 1970-01-01
      • 2022-01-25
      • 2013-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多