Title: modify a commentpress template
Last modified: August 21, 2016

---

# modify a commentpress template

 *  Resolved [carlsandburg](https://wordpress.org/support/users/carlsandburg/)
 * (@carlsandburg)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/modify-a-commentpress-template/)
 * I’ve figured out (more or less) how to change the css of CommentPress. Now I 
   want to start modifying the templates.
 * I already created a child theme.
 * My “long-term” goal is to modify the Header to include a button that take the
   user to the Blog, but for now, i want to just add some random text.
 * i found the template i want to modify.
 * header_body.php – i added one line (“hello there”).
 * <div id=”page_title”>
    <div id=”title”><h1>” title=”<?php _e( ‘Home’, ‘commentpress-
   core’ ); ?>”><?php bloginfo(‘title’); ?>
   </h1></div>
    <div id=”tagline”><?php
   bloginfo(‘description’); ?></div> <div id=”tagline”><?php echo ‘hello there’;?
   ></div> </div>
 * now comes the problem. i’ve tried putting it here
 * /wp-content/themes/commentpress-modern-child/header_body.php
 * and here
 * /wp-content/themes/commentpress-modern-child/assets/templates
 * but when i go to the page i don’t see “Hello there”
 * Maybe I’m missing a step?
 * thanks
 * [http://wordpress.org/plugins/commentpress-core/](http://wordpress.org/plugins/commentpress-core/)

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

 *  Plugin Author [Christian Wach](https://wordpress.org/support/users/needle/)
 * (@needle)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/modify-a-commentpress-template/#post-4423388)
 * Ah yes, it is a little more complicated than that. CommentPress predates many
   of the capabilities for child themes to override parent theme templates, so instead
   there are filters that have to be applied. I plan to update this at some point.
   Anyway, here’s what you need to do:
 *     ```
       /**
        * @description: override header_body template by intercepting value
        */
       function my_header_body_template() {
       	return get_stylesheet_directory() . '/assets/templates/header_body.php';
       }
       add_filter('cp_template_header_body', 'my_header_body_template');
       ```
   
 * Hope that helps. Cheers, Christian
 *  Thread Starter [carlsandburg](https://wordpress.org/support/users/carlsandburg/)
 * (@carlsandburg)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/modify-a-commentpress-template/#post-4423462)
 * Thanks, that helps. I added that code to my child theme – /wp-content/themes/
   commentpress-modern-child/header.php (at the bottom).
 * This code does seem to get executed.
 * However, it seems that header_body is still being executed from /plugins/commentpress-
   core/themes/comment-press-modern/assets/templates/header_body.php instead of 
   from the same directory in my child theme.
 * Maybe there’s something else i need to do as well? It’s probably something basic–
   I’m still new to this…..
 * any thoughts?
 *  Thread Starter [carlsandburg](https://wordpress.org/support/users/carlsandburg/)
 * (@carlsandburg)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/modify-a-commentpress-template/#post-4423467)
 * NEVERMIND! figured it out. It goes in function.php. I’m going to get this all
   figured out one day 🙂
 * thanks!
 *  Thread Starter [carlsandburg](https://wordpress.org/support/users/carlsandburg/)
 * (@carlsandburg)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/modify-a-commentpress-template/#post-4423473)
 * ok – got a link to the blog on the header now.
 * [http://stevelescure.net/wp/](http://stevelescure.net/wp/)

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

The topic ‘modify a commentpress template’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/commentpress-core_9b6041.svg)
 * [CommentPress Core](https://wordpress.org/plugins/commentpress-core/)
 * [Support Threads](https://wordpress.org/support/plugin/commentpress-core/)
 * [Active Topics](https://wordpress.org/support/plugin/commentpress-core/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/commentpress-core/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/commentpress-core/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [carlsandburg](https://wordpress.org/support/users/carlsandburg/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/modify-a-commentpress-template/#post-4423473)
 * Status: resolved