0

我正在做一个在线商店项目。我创建了一个帖子类型,即产品和分类 products_categories Men Wearing、Women wear 和 kids 等。在侧边栏中,我创建了一个小部件并显示所有自定义分类。现在我想显示与该特定类别相关的所有产品。因此,当我单击任何类别假设男性时,我的 url 看起来像“htp://mydomain/mysite/product_categories/kids-clothing/”。我创建了一个 taxonomy.php,但 404.php 仍在运行。有人可以告诉我 ht 代码有什么问题吗?

'
<?php
   $taxonomy     = 'product_categories';
   $orderby      = 'name';
   $show_count   = 0;      // 1 for yes, 0 for no
   $pad_counts   = 0;      // 1 for yes, 0 for no
   $hierarchical = 1;      // 1 for yes, 0 for no
   $title        = '';
   $empty        = 0;

   $args = array(
     'taxonomy'     => $taxonomy,
     'orderby'      => $orderby,
     'show_count'   => $show_count,
     'pad_counts'   => $pad_counts,
     'hierarchical' => $hierarchical,
     'title_li'     => $title,
     'hide_empty'   => $empty
   );

   ?>
   <h4 class="title1">Show By Category</h4>
   <ul id="list">
   <?php 
     wp_list_categories( $args );
   ?>
   </ul>'

谢谢。

4

0 回答 0