Theme author, Ben Word, has been working for some time on Roots: “a starting WordPress theme based on HTML5 Boilerplate & Bootstrap from Twitter.” Back in November, Word wrote an article about how they’re hiding the fact that the theme is powered by WordPress.
In the Roots theme we’re taking several steps to ensure that a visitor to your website won’t know that you’re using WordPress
They do some interesting things, including rewriting URLs to theme assets & plugins to hide the wp-content
directory and rewriting URLs to root-relative addresses. Additionally there’s a “walker” class for custom navigation menus, so you could do something like:
wp_nav_menu(array('theme_location' => 'primary_navigation', 'walker' => new roots_nav_walker()));
I’m offering it here as a plugin with some minor changes. Word’s original post is code directly from the Roots theme which is meant to “hide” the fact that a site is running on WordPress. That’s fine for them. I didn’t want to make any decisions about where the assets folder should be for an unsuspecting person who may have been using WordPress for some time. Cleaning wp_head
sounds good in practice and I’m sure there’s some stuff in there that most people don’t need, but there’s a reason it got so messy in the first place. I’m still doing a bit of cleaning there, the scripts to make tagging word in Windows Live Writer will be removed along with the wp_generator
script that writes out the WordPress version to a meta tag — it’s considered to be a security risk to let people know your WordPress version.
Hi Josh,
I was looking at the roots site last night then came accross your plugin.
May I ask please what you can use it for.
So, in the Roots theme they’re trying to hide the fact that WordPress is the CMS behind the site. There are many reasons you would want to do this. Some people don’t like the markup WordPress generates. Some people don’t feel safe when people know they’re on WordPress. I happen to like it because it rewrites all URLs to be root relative. So when you’re creating a new theme, all assets are rewritten to /js, /css, or /images — assuming you follow the HTML5 Boilerplate model.
Hi Josh,
Interesting plugin! So after I install wp and activate the plugins… What changes should I make to my wp files in order for the theme to work again?
Thanks
Everything is going to be root relative so if WordPress isn’t installed as the root it might not even work. I’ll have to look into this later. I don’t think I had to do anything to get it to work.
Aha OK. I moved the installation from the root and it works.. nice! but I had to adjust the location of the style.css first so wp can find it… or is there other method? thanks
Just to clarify, this plugin will only work with the Roots theme, correct?
No. It would actually be kind of pointless to use it with the Roots theme since all this functionality is already present. The plugin is meant for people that want these features without running the roots theme.
Nice plug-in, finally you made this one. You said all assets should put in folder /js, /css and /images… so I did. Now, the style.css wont display my images. I tried put like this one – “../images/picture.jpg” but still no display. Any tips how to solve this small problem? tnx for advance.
Are there plans to make this multisite capable ? I am thinking it may not be as listed only tested up to 3.3
TIA!
Is there a way to use this plugin in combination with this plugin?: http://wordpress.org/extend/plugins/mobile-theme-switcher/
The mobile theme version plugin selects another team if a visitor visits the website from mobile. But i can’t put two different styles and images in the root. One for desktop, one for mobile. Mobile and desktop version loads the .php files from his own theme in the theme folder, but both of them uses the same css, js, img, files from the root.
I need one version for mobile, and one version for desktop.
The only solution is to redirect mobile users to a subdomain (m.domainname.com), with a whole new wordpress installation, i think.
Or am i wrong?
You don’t actually need to move your theme assets. The plugin only makes it look like they’re moved.
But, when i active the plugin, and i don’t have the .css and the .js files in the root, it doesn’t read these files. Only the .php files. When i put the css and .js files in the root, it does read these files.
So, your theme’s ‘css’ folder should be rewritten to the root, meaning style.css should be accessible from
/css/style.css
. Everything in the ‘js’ folder gets rewritten to/js
. The ‘images’ folder works the same way.There should be some rules generated in your
.htaccess
file. If there aren’t, the plugin won’t work.Hey Josh, is there a way to modify your plugin to also catch /wp-includes directories?
For example:
/wp-includes/js/jquery/jquery.js?ver=1.7.2
/wp-includes/js/comment-reply.js?ver=3.4.2