Title: functions.php &#8211; am I doing it right?
Last modified: August 21, 2016

---

# functions.php – am I doing it right?

 *  [loudnotes](https://wordpress.org/support/users/loudnotes/)
 * (@loudnotes)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/functionsphp-am-i-doing-it-right/)
 * I am a PHP novice and have managed to do some basic customization using functions.
   php without breaking anything, but I feel like I’m missing something. Would someone
   be so kind as to tell me if there is a better way to approach this situation 
   so I can better understand how to apply it to other filters?
 * I wanted to change the 404 page header from “Ooops” to “Oops”. The following 
   function in functions.php of my child theme:
 * >     ```
   >     add_filter('tc_404_header_content', 'tc_404_new');
   >     function tc_404_new(){
   >     echo '<header class="entry-header">
   >     <h1 class="entry-title">Oops, page not found</h1>
   >     <hr class="featurette-divider __before_content">
   >     </header>';
   >     }
   >     ```
   > 
 * correctly replaces the below text generated in class-content-headings.php. I 
   have archive icons disabled.
 * >  ‘if ( is_404() ) {
   >  $header_class = ‘entry-header’; $content = sprintf(‘<h1
   > class=”entry-title %1$s”>%2$s</h1>’, apply_filters( ‘tc_archive_icon’, ” ),
   > apply_filters( ‘tc_404_title’ , __( ‘Ooops, page not found’ , ‘customizr’ )));
   > $content = apply_filters( ‘tc_404_header_content’, $content ); }’
 * The reason I think I did something wrong is I had to manually type oout the HTML
   code for the header tags and <hr> featurette-divider tag, which were previously
   automatically generated. I think maybe I don’t fully understand the role of the
   second parameter in apply_filters. What does `,'customizr')` mean in this context?
   Is it a defined variable somewhere?
 * Is there another, better way to make this sort of change in functions.php?
 * Thanks for any insights!

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

 *  [rdellconsulting](https://wordpress.org/support/users/rdellconsulting/)
 * (@rdellconsulting)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/functionsphp-am-i-doing-it-right/#post-4469397)
 * Try adding this to your child theme functions.php:
 *     ```
       add_filter('tc_archives_headings', 'rdc_archives_headings');
       function rdc_archives_headings($output) {
           return preg_replace('|Ooops|', 'Oops', $output);
       }
       ```
   
 *  Thread Starter [loudnotes](https://wordpress.org/support/users/loudnotes/)
 * (@loudnotes)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/functionsphp-am-i-doing-it-right/#post-4469438)
 * Neat trick, thanks! I knew there had to be a better way.
 * For future reference though, if I’m replacing more than just a letter, what is
   the role of ‘customizr’ in assigning formatting? How would I call tc_404_title
   or tc_archive_icon or other functions from within functions.php?
 *  [ElectricFeet](https://wordpress.org/support/users/electricfeet/)
 * (@electricfeet)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/functionsphp-am-i-doing-it-right/#post-4469453)
 * The best way is to continue reading the Customizr site and this forum, to get
   confident with Customizr and php. In the meantime, use the [Say What?](http://wordpress.org/plugins/say-what/)
   plugin to change any string to any other (tip: the “domain” in the Say What? 
   settings is `customizr`).

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

The topic ‘functions.php – am I doing it right?’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)

 * 3 replies
 * 3 participants
 * Last reply from: [ElectricFeet](https://wordpress.org/support/users/electricfeet/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/functionsphp-am-i-doing-it-right/#post-4469453)
 * Status: not resolved