2013-03-24 78 views
0

我有一个称为产品的自定义发布类型,每个产品都有一个自定义类别的商业,住宅或零售。在访问以下网址时:http://176.67.171.11/airvent/product/aquaguard/您可以在左侧看到类别列表。点击,您将获得所有常规博客帖子的存档页面,而不是该类别的自定义帖子类型帖子。 我已经添加了archive-product.php,但它似乎并没有将其拉入?自定义分类不显示

我错过了什么?

在此先感谢。

我的代码:(从pastebin

register_taxonomy('product_range_cat', 
    array('product'), 
    array('hierarchical' => true,     
     'labels' => array(
      'name' => __('Product Categories', 'bonestheme'), 
      'singular_name' => __('Product Category', 'bonestheme'), 
      'search_items' => __('Search Product Categories', 'bonestheme'), 
      'all_items' => __('All Product Categories', 'bonestheme'), 
      'parent_item' => __('Parent Product Category', 'bonestheme'), 
      'parent_item_colon' => __('Parent Product Category:', 'bonestheme'), 
      'edit_item' => __('Edit Product Category', 'bonestheme'), 
      'update_item' => __('Update Product Category', 'bonestheme'), 
      'add_new_item' => __('Add New Product Category', 'bonestheme'), 
      'new_item_name' => __('New Product Category Name', 'bonestheme') 
     ), 
     'show_ui' => true, 
     'query_var' => true, 
     'rewrite' => array('slug' => 'product-category'), 
    ) 
); 
+0

请发布与您的自定义分类法相关的代码。 – 2013-03-24 15:27:49

+0

这里是一个代码的pastebin:http://pastebin.com/cjRRbM11 – 2013-03-24 18:17:22

+0

你是否尝试将永久链接切换回默认值,然后返回到您当前的设置又名永久链接? – 2013-03-24 19:21:31

回答

0

问题解决了,这是一个片段,我发现排除loop.php产品类别类型:

<?php query_posts($query_string . '&cat=-4'); //Custom query to exclude category/ies ?>

我仍然不明白为什么它不会调用archive-product.php?

感谢您的帮助。

相关问题