Genesis Tutorials

Using Hooks In Woo Themes

Unlike the Genesis and Thesis hook plugins, the Woo Hook Manager in the Canvas theme doesn’t enable you to execute PHP or Javascript code.

So whats the solution?

You’ll need to add the code in your themes templates files or better still, write a custom function which you can also use with conditional tags.

Lets take a look at some examples of code you can add to your child themes functions.php file to display banners, ads or pretty much anything else in different hook locations your Woo theme offers.

Display In WordPress Footer Based On Conditions

This code will work in any theme because it uses a WordPress hook and not a theme specific hook.

Change the conditional tag to whatever you like.

In the above example i’ve used a conditional tag for pages and added the page i.d of 100 which you will change to your own.

Execute Code In Any Theme Head Section

If you simply want to display content using the wp_head hook in WordPress, you can add this code to your child themes functions.php file.

This code will work with any theme.

You can change the WordPress hook wp_head to any other hook including theme specific hooks.

Note: Using the wp_head hook to load Javascript requires the files to be enqueued before the wp_head action hook.

Woo Specific Hooks

This code will output your content after the posts content in a Woo theme only.

You can easily change the Woo ‘woo_post_after’ hook to another.

The below example will output your HTML before the posts content.

But Wait! There’s a Problem.

The code will also output on archives pages like you blog or homepage. So how do we fix that?

We add a conditional tag so it only displays on single posts and/or single pages. Not on archive pages.

Add Content After All Single Posts

This code displays after all posts on single posts only.

Add Content Before All Single Posts

This code displays before all page content on pages only including archive pages.

These are some examples which you can use in a Woo theme. The code snippets using the WordPress wp_head or wp_footer action hooks can be used in any theme.

Hook Reference Map

Here’s a complete list of Woo hooks displayed in a visual map.

10 replies on “Using Hooks In Woo Themes”

Hi Brad,

Is there a way to modify this so that it shows after the first post only?


add_action('woo_post_after', 'wpsites_display_content_post_after');
function wpsites_display_content_post_after() {
echo 'Display Content Site Wide Post After Hook';

Hi Brad,

What I am trying to do is add content after the first and second posts on the archive pages.

Sorry for the confusion,


Hi Brad, being that Canvas doesnt allow us to execute PHP or Javascript code, how would I relocate the post titles and meta data above the Featured Image? I think its strange that these items are reversed and most of my clients want their posts to display this way. Any hints would be appreciated!

I think the best solution would be to use something like what you can use with Genesis like a remove_action and then add_action.

You just need to find the correct hook and function names which isn’t that easy in Canvas as there’s over 100 files.

Another solution is to copy over the files to your child theme and edit theme there but that’s really not the best method.

I would ask this question on the Woo Community forums and see if you get answer but i don’t know the exact action names and would need to look in the files to find them.

Add the


conditional tag after the function.

function slider_front_page() {
if (is_front_page() && function_exists( 'soliloquy_slider' ) ) {
soliloquy_slider( '88' );
add_action('woo_header_inside', 'slider_front_page');

Brad, you’re a rockstar!

Dear WP Sites readers, I asked a quickie question in a comment the other day to Brad and not only did he answer it, he wrote up a whole post pummeling the question with several solutions. That is going above and beyond.

Big brownie points in my book, Brad. How can I return the favor? IMHO, the WordPress world is one of cooperation and it’s been working great for me for years. Let me know if you need anything.

Best regards,


hahaha! Its because you’ve got a cool name Bradley! I really do appreciate it when my readers leave comments and tell me what they need because it gives me ideas on what to write about. Keep them coming because i need to offer a diverse range of solutions and don’t want to focus on one specific theme. Cheers

Leave a Reply

Your email address will not be published. Required fields are marked *