Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- **================================================================================================================**
- * Rewrite Root Rules
- **================================================================================================================**
- **================================================================================================================**
- **/
- add_action('generate_rewrite_rules', 'roots_add_rewrites');
- function roots_add_rewrites($content) {
- $theme_name = next(explode('/themes/', get_stylesheet_directory()));
- global $wp_rewrite;
- $roots_new_non_wp_rules = array(
- // '(img|js|css|fonts)/(.*)' => 'wp-content/themes/'. $theme_name . '/$1/$2',
- '(?:\/)?[a-zA-Z\d\/]*?\/?(img|js|css|fonts)\/(.*)' => 'wp-content/themes/'. $theme_name . '/$1/$2'
- );
- $wp_rewrite->non_wp_rules += $roots_new_non_wp_rules;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement