What It Is
WP Hooks is a plugin for WordPress that allows you to add JavaScript, HTML, etc. (not PHP, maybe in a future release) to your header and footer without modifying your theme. WP Hooks uses the wp_head() and wp_footer() hooks built in to WordPress to add content to your header and/or footer. It’s great for those who have custom JavaScript, CSS, or other code (Google Analytics, meta tags, etc.) in their header or footer and don’t want to copy that every time they change themes.
Screenshots
Frequently Asked Questions
- I’ve added content but why is it not showing up in my header/footer?
- WP Hooks assumes that
wp_head()andwp_footer()are in your theme. According to the WordPress documentation onwp_head():This hook is theme-dependent which means that it is up to the author of each WordPress theme to include it.
If one of the hooks is not in your theme, you could add it yourself by adding
<?php wp_head(); ?>to your header.php file of your theme or<?php wp_footer(); ?>to footer.php.
Changelog
1.0.3 – March 3, 2009
- The options page (still) wasn’t working in WordPress MU. I’ve added in a check to see if the new function settings_fields() is available, and if it is, the options page uses that. If settings_fields() is not available (older WP versions) the wp_nonce_field() function is still used. I’ve tested the plugin in WPMU 2.7 and it works.
1.0.2 – March 2, 2009
- The options page wasn’t working in WordPress MU, so now I’m using add_options_page instead of add_submenu_page to add the options page to the Settings menu.
1.0.1 – March 1, 2009
- Added a fix to the function that displays the ‘Settings’ link in the WordPress activated plugins list.
1.0 – March 1, 2009
- First version.
flickr.com/photos/andrewmwhalen
linkedin.com/in/andrewmwhalen
twitter.com/awhalen
youtube.com/user/whalena
Screenshot of WP Hooks options page.
03/02/2009 at 10:10 am
hi. Thanks for plugin
perfect.
Regards
03/02/2009 at 4:58 pm
Your plugin is a great idea, but when I attempt to save changes I get the following error:
“Error! Options page not found.”
I am running WordPress MU if that makes a difference.
03/02/2009 at 5:34 pm
@Tom I added version 1.0.2 to the WordPress Plugin Directory. Try upgrading to that version to see if it works on WPMU now.
03/02/2009 at 6:35 pm
Thanks for the really fast reply. I installed 1.0.2 on my server, but I get the same error. Could my permissions cause this?
03/03/2009 at 12:24 pm
@Tom I’ve tested WP Hooks 1.0.3 on WPMU 2.7 and it works. If you have an older version of WPMU let me know and I’ll see what I need to do to make it work for that version.
03/03/2009 at 3:35 pm
I have 2.7 installed, but may have my permissions on some of my folders wrong. Everything else on my system works and this is my third MU set up, but I have have to adjust folder permissions for other plugins, so I suspect it is that.
04/22/2009 at 5:23 pm
It’s a great idea. One thing missing though: PHP execution. I cannot use it whenever I have custom PHP in my header/foother (e.g. I don’t want Sitemeter script to count admin visits, so I enclose it with )
If you can support this, the next step is to expand the functionality to other hooks besides the header/footer? For example, it would be nice to be able to override “the_posts()” or the_content (don’t remember if that’s the right one) without having to modify the theme.
It’s a great idea anyway. Thanks.
04/23/2009 at 10:58 am
Nice plugin idea – I am looking for an extended version with many more hooks.
Have you heard of such a thing for wordpress general ?
There are some great hooks plugins for a couple of specific themes: K2 ( http://wordpress.org/extend/plugins/k2-hook-up/ ) and Thesis ( http://wordpress.org/extend/plugins/thesis-openhook/ )
05/10/2009 at 10:35 pm
Would be great to be able to add some php code.
06/12/2009 at 10:06 pm
is hooks working with Thesis 1.5.1? Because I installed and activated it, but nothing is showing up in my menus that says “hooks.”
06/13/2009 at 10:31 pm
Does Thesis style the WordPress Admin area different than the default? Since Thesis is a paid theme I can’t download it and see what’s going on.
06/17/2009 at 8:23 am
For the Thesis theme this is the way to go:
http://wordpress.org/extend/plugins/thesis-openhook/
08/03/2009 at 8:24 am
Hello sir,
I need a plugin for add Javascript in Userside Post display part. I need some javascript functions to create some popup. So pls give an idea how to include javascript on Userside post page without Edit theme page or any other page only using some plugin functionality.
Thanks
Bye Anes
03/06/2010 at 11:55 pm
thanks sir, it works for me…so simple and efficient
05/05/2010 at 8:02 pm
Hello,
We are running wordpress-MU 2.6 and wanted to add jsMath, which requires your WP-hooks. I did the install, that is, of jsMath, and put WP-hooks in the plugins directory, then went to the site on wordpress-MU where we wanted it, pushed the ‘activate’ button and everything went blank. And now when you login, the wp-admin page is blank. The other sites in our wordpress-MU admins work fine, just the one where I pushed the activate button. So, some fatal error is occurring causing php to stop. Is it because our wordpress is old? Is because it is the MU version?
Thanks,
05/06/2010 at 7:01 pm
Hello,
Using WordPress-MU 2.6, I get the following PHP Fatal error:
Call to undefined function register_setting() in /var/www/html/wordpress-mu-2.6/wp-content/plugins/wp-hooks/wp-hooks.php on line 119
which kills the admin page.
Can this be fixed?
thanks
02/24/2011 at 5:02 pm
Hi,
I’m trying to use your plugin with WPML language plugin, and can’t seem to get the text to translate properly… please help if you can!
http://wpml.org/faq/getting-string-translation-to-work/
thanks.