Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fix_slash( $string, $type )
- {
- global $wp_rewrite;
- if ( $wp_rewrite->use_trailing_slashes == false )
- {
- if ( $type != 'single' && $type != 'category' )
- return trailingslashit( $string );
- if ( $type == 'single' && ( strpos( $string, '.html/' ) !== false ) )
- return trailingslashit( $string );
- if ( $type == 'category' && ( strpos( $string, 'category' ) !== false ) )
- {
- $aa_g = str_replace( "/category/", "/", $string );
- return trailingslashit( $aa_g );
- }
- if ( $type == 'category' )
- return trailingslashit( $string );
- }
- return $string;
- }
- add_filter( 'user_trailingslashit', 'fix_slash', 55, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement