Last active
August 29, 2015 14:08
-
-
Save derpixler/e0766020f096e56f6af6 to your computer and use it in GitHub Desktop.
[WordPress - Multisite] Remove Blog-Slug From Permalink Structure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Remove Blog-Slug From Permalink Structure | |
* | |
* @author René Reimann <info@rene-reimann.de> | |
* @return viod | |
*/ | |
function rr2_rbsfps(){ | |
global $wp_rewrite; | |
$wp_rewrite->set_permalink_structure( str_replace( '/blog', '', get_option('permalink_structure') ) ); | |
$wp_rewrite->set_category_base( str_replace( '/blog', '', get_option('category_base') ) ); | |
flush_rewrite_rules(); | |
} | |
add_action( 'init', 'rr2_rbsfps' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment