Title: Add HTML using Filter Hooks
Last modified: August 20, 2016

---

# Add HTML using Filter Hooks

 *  [JonMeek](https://wordpress.org/support/users/jonmeek/)
 * (@jonmeek)
 * [14 years ago](https://wordpress.org/support/topic/add-html-using-filter-hooks/)
 * I am trying to add some HTML code to a child theme. I know I can create templates
   for my child theme to override the parent theme’s files, but I am trying to see
   if there is a way to do it in the functions.php file.
 * I want to add a little HTML right after the header.php file, and then right before
   the footer.php file. I am thinking that filter hooks should be the way to do 
   this, but I can’t find the right hooks. Am I looking in the right direction?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [14 years ago](https://wordpress.org/support/topic/add-html-using-filter-hooks/#post-2636521)
 * Does it have to be exactly right after the header and right before the footer?
   It’s really easy to output HTML using `wp_head` and `wp_footer` filters.
 *     ```
       add_filter( 'wp_head' , 'your_function' );
       function your_function() {
          echo '<!-- head html code here -->';
       }
       ```
   
 * and
 *     ```
       add_filter( 'wp_footer' , 'your_other_function' );
       function your_other_function() {
          echo '<!-- footer html code here -->';
       }
       ```
   
 *  Thread Starter [JonMeek](https://wordpress.org/support/users/jonmeek/)
 * (@jonmeek)
 * [14 years ago](https://wordpress.org/support/topic/add-html-using-filter-hooks/#post-2636610)
 * Hey Jan, thanks for the reply.
 * Yep, I did try wp_head just as you suggested. The problem with that is it places
   the code inside the HTML <head></head> tag.
 * To be a little clearer about what I’m trying to accomplish: I have created a 
   child theme for Twenty Eleven, and I want to add a div between the “branding”
   and “main” divs.
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [14 years ago](https://wordpress.org/support/topic/add-html-using-filter-hooks/#post-2636719)
 * > I have created a child theme for Twenty Eleven, and I want to add a div between
   > the “branding” and “main” divs.
 * Ah, that makes sense. Doing via hooks is attractive but I think the only way 
   to pull it off reliably is to modify a child theme’s copy of the parent template
   file.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add HTML using Filter Hooks’ is closed to new replies.

## Tags

 * [filter hooks](https://wordpress.org/support/topic-tag/filter-hooks/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/add-html-using-filter-hooks/#post-2636719)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
