Skip to content

Instantly share code, notes, and snippets.

@derpixler
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derpixler/e0766020f096e56f6af6 to your computer and use it in GitHub Desktop.
Save derpixler/e0766020f096e56f6af6 to your computer and use it in GitHub Desktop.
[WordPress - Multisite] Remove Blog-Slug From Permalink Structure
<?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