我已创建自定义帖子类型
public function register_post_types() {
$args = array(
\'labels\' => array(
\'name\' => \'Android Apps\',
\'singular_name\' => \'Android App\',
\'add_new\' => \'Add New App\',
\'add_new_item\' => \'Add New App\',
\'edit_item\' => \'Edit App\',
\'new_item\' => \'New App\',
\'view_item\' => \'View App\',
\'search_item\' => \'Search App\',
\'not_found\' => \'No Apps Found\',
\'not_found_in_trash\' => \'No Apps Found in Trash\'
),
\'query_var\' => \'apps\',
\'rewrite\' => array(
\'slug\' => \'apps\',
),
\'public\' => true,
\'has_archive\' => true,
\'menu_position\' => 5,
\'menu_icon\' => admin_url(). \'images/media-button-video.gif\', //Icon url
\'supports\' => array(
\'title\',
\'thumbnail\',
\'editor\',
)
);
register_post_type(\'apps\', $args);
flush_rewrite_rules();
}
这些帖子对这种风格的permalinks给出了404分
http://site/apps/flashlight虽然它们在平原永久林上效果很好http://site/?apps=flashlight