Removing Existing Content From Actions
In some themes, like Thematic, some of the Action Hooks are already partly filled up with stuff. This might look a little unusual if you’ve never seen it before but it’s insanely powerful. You can basically unplug parts of your theme.
Here’s the basic syntax for removing content from your Theme that’s already being hooked-in.
1
2
3
4
5
6
|
// Unhook default Thematic functions function unhook_thematic_functions() { // Don't forget the position number if the original function has one remove_action( 'thematic_hook_name' , 'thematic_function_name' ,postitionnumber); } add_action( 'init' , 'unhook_thematic_functions' ); |
And as an example, here’s a code snippet that will remove the entire main navigation menu from your Thematic Theme. Just pop it into your Child Theme functions.php
and let it rip.
1
2
3
4
5
6
|
// Unhook default Thematic functions function unhook_thematic_functions() { // Don't forget the position number if the original function has one remove_action( 'thematic_header' , 'thematic_access' ,9); } add_action( 'init' , 'unhook_thematic_functions' ); |
Combine these 2 concepts with a hooked-up WordPress Theme and you can do practically anything.