以下內容属于 ‘链接优化’ 便签:

wordpress去除掉链接的category

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566//去除分类标志代码 add_action( 'load-themes.php',  'no_category_base_refresh_rules'); add_action('created_category', 'no_category_base_refresh_rules'); add_action('edited_category', 'no_category_base_refresh_rules'); add_action('delete_category', 'no_category_base_refresh_rules'); function no_category_base_refresh_rules() {     global $wp_rewrite;     $wp_rewrite -> flush_rules(); } // register_deactivation_hook(__FILE__, 'no_category_base_deactivate'); // function no_category_base_deactivate() { //  remove_filter('category_rewrite_rules', 'no_category_base_rewrite_rules'); //  // We don't want to insert our custom rules again //  no_category_base_refresh_rules(); // } // Remove category base add_action('init', 'no_category_base_permastruct'); function […] (more...)