admin管理员组文章数量:1418656
I am working on clients website and I have added the Custom post type plugin for creating the new section and I have also added the taxonomies for that.
In my page, I have added the default categories drop-down select box but the problem is that, it is not showing the taxonomies added for the Custom post type.
So, I went to the wp-includes/category-template.php
and edited the file.
function wp_dropdown_categories( $args = '' ) {
$defaults = array(
'show_option_all' => '',
'show_option_none' => '',
'orderby' => 'id',
'order' => 'ASC',
'show_count' => 0,
'hide_empty' => 1,
'child_of' => 0,
'exclude' => '',
'echo' => 1,
'selected' => 0,
'hierarchical' => 0,
'name' => 'cat',
'id' => '',
'class' => 'postform',
'depth' => 0,
'tab_index' => 0,
'taxonomy' => 'project_type',
'hide_if_empty' => false,
'option_none_value' => -1,
'value_field' => 'term_id',
'required' => false,
);
$defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0;
function wp_list_categories( $args = '' ) {
$defaults = array(
'child_of' => 0,
'current_category' => 0,
'depth' => 0,
'echo' => 1,
'exclude' => '',
'exclude_tree' => '',
'feed' => '',
'feed_image' => '',
'feed_type' => '',
'hide_empty' => 1,
'hide_title_if_empty' => false,
'hierarchical' => true,
'order' => 'ASC',
'orderby' => 'name',
'separator' => '<br />',
'show_count' => 0,
'show_option_all' => '',
'show_option_none' => __( 'No categories' ),
'style' => 'list',
'taxonomy' => 'project_type',
'title_li' => __( 'Categories' ),
'use_desc_for_title' => 1,
);
$r = wp_parse_args( $args, $defaults );
In place of 'taxonomy' => 'category'
, I added this 'taxonomy'=> 'project_type'
, Now the taxonomies are showing but the search according to the drop-down select box is not working. It is showing page not found.
Do I have to go the Setting > Permalinks and click save button?
Any help is much appreciated.
本文标签: custom post typesTaxonomies are not showing in the category dropdown
版权声明:本文标题:custom post types - Taxonomies are not showing in the category dropdown 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745295462a2652049.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论