July 23, 201313 yr Hello, hello. I've picked up some code from the web to put in my functions file. It's from a reputable source (hongkiat.com) but I can't get it to work, can any one tell why this doesn't work? add_action('generate_rewrite_rules', 'themes_dir_add_rewrites'); function themes_dir_add_rewrites() { $theme_name = next(explode('/themes/', get_stylesheet_directory())); global $wp_rewrite; $new_non_wp_rules = array( 'css/(.*)' => 'wp-content/themes/'. $theme_name . '/css/$1', 'js/(.*)' => 'wp-content/themes/'. $theme_name . '/js/$1', 'images/wordpress-urls-rewrite/(.*)' => 'wp-content/themes/'. $theme_name . '/images/wordpress-urls-rewrite/$1', ); $wp_rewrite->non_wp_rules += $new_non_wp_rules; } Edited July 23, 201313 yr by Lyndsey placed code tags around code
July 23, 201313 yr Doesn't Wordpress have a configuration setting for your file directories? Most CMS's allow you to configure upload destinations somehow... Edited July 23, 201313 yr by BlueDreamer
Create an account or sign in to comment