是否可以不对自定义帖子类型的基本URL使用循环。
例如,如果我的自定义帖子类型是“directory”。
我不想http://www.mysite.com/directory/ 为了到达循环页面,我想制作一个自定义页面模板,该模板将根据分类法等提供自定义布局,以便进入自定义帖子类型的区域。
但是,对于单个帖子,我仍然希望在URL中保留自定义帖子类型名称。
因此-http://www.mysite.com/directory/listing_type/listing_locale/postname/
如果有人能帮忙,我将不胜感激。
编辑-创建后代码段
register_post_type( \'directory\',
array(
\'labels\' => array(
\'name\' => __( \'Directory Listing\' ),
\'singular_name\' => __( \'Directorys\' ),
\'add_new\' => __( \'Add directory listing\' ),
\'add_new_item\' => __( \'Add directory listing\' ),
\'edit\' => __( \'Edit\' ),
\'edit_item\' => __( \'Edit Directory\' ),
\'new_item\' => __( \'Add a directory listing\' ),
\'view\' => __( \'View Directory\' ),
\'view_item\' => __( \'View Directory\' ),
\'search_items\' => __( \'Search Directorys\' ),
\'not_found\' => __( \'No Directory found\' ),
\'not_found_in_trash\' => __( \'No Directory found in Trash\' ),
\'parent\' => __( \'Parent Directorys\' ),
),
\'public\' => true,
\'query_var\' => true,
\'menu_position\' => 35,
\'show_ui\' => true,
\'supports\' => array(\'title\',\'thumbnail\',\'page-attributes\',\'revisions\'),
\'publicly_queryable\' => true,
\'exclude_from_search\' => true,
\'hierarchical\' => true
)
);