你好,我想更改我的分类法并发布permalink。我有这样的分类法;
宝马1系问题1)如何更改永久链接taxonomy 像网站。com/brand/audi网站。com/brand/audi/a1网站。com/brand/audi/a1/14 tfsi网站。com/品牌/奥迪/a1/16 tdi网站。com/brand/bmw网站。com/brand/bmw/1系网站。com/brand/bmw/1系/115d问题2)如何更改permalinkposts
网站。com/bmw/1-series/115d/post-title网站。com/audi/a1/16 tdi/post title这是我使用的代码;
## Auto Post Type
function autoCats() {
## Brand - Model - Version
register_taxonomy(
\'brand\',
\'auto\',
array(
\'hierarchical\' => true,
\'label\' => \'Marka / Model / Versiyon\',
\'query_var\' => true,
\'rewrite\' => array(
\'slug\' => \'marka\',
\'with_front\' => false
)
)
);
}
add_action( \'init\', \'autoCats\', 0 );
function autoRegister() {
$labels = array(
\'name\' => _x( \'Araç\', \'catchthemes_custom_post\',\'catchthemes\' ),
\'singular_name\' => _x( \'Araç\', \'catchthemes_custom_post\', \'catchthemes\' ),
\'add_new\' => _x( \'Araç Ekle\', \'catchthemes_custom_post\', \'catchthemes\' ),
\'add_new_item\' => _x( \'Yeni Bir Araç Ekle\', \'catchthemes_custom_post\', \'catchthemes\' ),
\'edit_item\' => _x( \'Aracı Düzenleyin\', \'catchthemes_custom_post\', \'catchthemes\' ),
\'new_item\' => _x( \'Yeni Araç\', \'catchthemes_custom_post\', \'catchthemes\' ),
\'view_item\' => _x( \'Aracı Önizleyin\', \'catchthemes_custom_post\', \'catchthemes\' ),
\'search_items\' => _x( \'Araç Ara\', \'catchthemes_custom_post\', \'catchthemes\' ),
\'not_found\' => _x( \'Henüz Araç Eklenmemiş\', \'catchthemes_custom_post\', \'catchthemes\' ),
\'not_found_in_trash\' => _x( \'Çöp Kutusunda Birşey Bulunamadı\', \'catchthemes_custom_post\', \'catchthemes\' ),
\'parent_item_colon\' => _x( \'Parent ThemePost:\', \'catchthemes_custom_post\', \'catchthemes\' ),
\'menu_name\' => _x( \'Araçlar\', \'catchthemes_custom_post\', \'catchthemes\' ),
);
$args = array(
\'labels\' => $labels,
\'hierarchical\' => true,
\'description\' => \'Araç\',
\'supports\' => array( \'title\', \'thumbnail\', \'editor\', \'comments\', \'custom-fields\' ),
\'taxonomies\' => array(\'brand\', \'post_tag\', \'auto_cat\'), // this is IMPORTANT
\'show_ui\' => true,
\'show_in_menu\' => true,
\'menu_position\' => 5,
\'menu_icon\' => get_stylesheet_directory_uri() . \'/img/iconAuto.png\',
\'show_in_nav_menus\' => true,
\'publicly_queryable\' => true,
\'exclude_from_search\' => false,
\'query_var\' => true,
\'can_export\' => true,
\'hierarchical\' => true,
//\'rewrite\' => true <-- this is what you need!
//\'rewrite\' => array(\'slug\' => \'%auto_cat%/%brand%\',\'with_front\' => false),
\'public\' => true,
\'has_archive\' => \'auto\',
\'capability_type\' => \'post\'
);
register_post_type( \'auto\', $args );
}
add_action( \'init\', \'autoRegister\', 20 );