Just building a WP theme and I trying to create everything from scratch so I can create my own framework and also to keep things as clean as possible.
I’ve noticed that as soon as I add the wp_head call WordPress adds a few lines of crap. It looks like most of it is for the admin bar but its inserted css into the head using the old text/css.
Just wondered if I can stop or change this css?
I know I can turn off the admin bar is this the only way?
Put this in your functions.php file
// clean head
remove_action(‘wp_head’, ‘parent_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘start_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, 10, 0);
// remove admin bar
The [Bones](http://themble.com/bones/ “Bones”) starter theme has a nice wp_head cleanup function I usually port over when I’m not using it as a base.
Thanks, didn’t know about this.
By the way when I added the footer call even more was added, is there a clean up for the footer too?
Don’t mind the admin bar but I can’t cope with this amount of junk.
One other thing, is there a way to stop WP using absolute paths to assets?
Check out [Roots](https://github.com/retlehs/roots/), in particular the various cleanup and stuff in /lib/. There’s some very useful things to mine there, even if you don’t want to use all of it.
interessting, will use it for my new theme too.
Thanks Melindrea once again!
I’ve been a bit of a numpty here, when I was seeing most of that junk I was logged in. Now I’ve logged out a lot of it has disappeared so most of it was the admin bar.
Thanks again for the links though!
In the past you had to edit WordPress core files to customize something. Now for most things there are [Hooks, Actions and Filters](http://codex.wordpress.org/Plugin_API). [WordPress Hooks Database](http://adambrown.info/p/wp_hooks) is another great resource to have handy.
You must be logged in to reply to this topic.