在我看来,有些简单的事情需要做,但我无法让它发挥作用。
我有一个自定义的帖子类型adm_project
具有rewrite => array(\'slug\' => \'projecten\')
add_action( \'init\', \'adm_build_projecten_post_type\', 0 );
function adm_build_projecten_post_type() {
register_taxonomy(
\'project_werkgebied\',
\'adm_project\',
array(
\'label\' => \'Werkgebieden\',
\'singular_label\' => \'Werkgebied\',
\'hierarchical\' => true,
\'query_var\' => true,
)
);
$labels = array(
\'name\' => \'Projecten\',
\'singular_name\' => \'Project\',
\'menu_name\' => \'Projecten\',
\'all_items\' => \'Alle Projecten\',
\'add_new\' => \'Project toevoegen\',
\'add_new_item\' => \'Nieuwe Project\',
\'edit\' => \'Bewerken\',
\'edit_item\' => \'Project bewerken\',
\'new_item\' => \'Nieuwe Project\',
\'view\' => \'Bekijken\',
\'view_item\' => \'Bekijk Projecten\',
\'search_items\' => \'Zoek Project\',
\'not_found\' => \'Geen Project(en) gevonden\',
\'not_found_in_trash\' => \'Geen Project(en) in prullenbak gevonden\',
\'parent\' => \'\',
);
$args = array(
\'label\' => \'Projecten\',
\'labels\' => $labels,
\'supports\' => array( \'title\', \'editor\', \'thumbnail\', \'excerpt\' ),
\'hierarchical\' => false,
\'public\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'show_in_nav_menus\' => true,
\'show_in_admin_bar\' => true,
\'menu_position\' => 20,
\'menu_icon\' => \'dashicons-hammer\',
\'can_export\' => true,
\'has_archive\' => true,
\'exclude_from_search\' => false,
\'publicly_queryable\' => true,
\'capability_type\' => \'page\',
\'rewrite\' => array( \'slug\' => \'projecten\' )
);
register_post_type( \'adm_project\', $args );
}
在主题中,我有一个文件名
archive-adm_project.php
其中显示了所有项目,包括所需的工作分页。
我想要的是当我去
/projecten/%project_werkgebied%
它的功能完全相同,但只显示具有url中的分类法的项目。