【问题标题】:Wordpress Custom Woocommerce category pageWordpress 自定义 Woocommerce 类别页面
【发布时间】:2020-02-12 21:16:46
【问题描述】:

我在 woocommerce 中的每个类别都有页面。列举如下:

http://example.com/parent-category/category-a
http://example.com/parent-category/category-b
http://example.com/parent-category/category-c

我想将最后一个链接自定义为自定义页面,但仍保留该链接,而不仅仅是进行重定向。

我目前使用WooCommerce Permalink Settings插件

【问题讨论】:

标签: wordpress woocommerce


【解决方案1】:

创建文件"some-single.php",然后创建"some-yourCategoryName"。现在打开single.php 并用下面的代码替换这个get_template_part('content','single');

用这个:

   if(is_category('yourCategoryName')){
        get_template_part('content','yourCategoryName');
    }else{
        get_template_part('content','single.php');
    }

会好的。

【讨论】:

    猜你喜欢
    • 2019-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-26
    • 2021-02-25
    • 1970-01-01
    • 1970-01-01
    • 2016-11-05
    相关资源
    最近更新 更多