Title: Remove function from child theme
Last modified: August 22, 2016

---

# Remove function from child theme

 *  Resolved [WH646](https://wordpress.org/support/users/wh646/)
 * (@wh646)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/)
 * Hi, my parent theme has a function that replaces the opening <p> with <p class
   =”lead”>. I’d like to remove this functionality altogether in my child theme.
   I’ve tried this a couple different ways in my child theme functions.php, but 
   I can’t seem to get it right. Any help would be much appreciated. The parent 
   theme function is:
 *     ```
       // Add lead class to first paragraph
       function wp_bootstrap_first_paragraph( $content ){
           global $post;
   
           // if we're on the homepage, don't add the lead class to the first paragraph of text
           if( is_page_template( 'page-homepage.php' ) )
               return $content;
           else
               return preg_replace('/<p([^>]+)?>/', '<p$1 class="lead">', $content, 1);
       }
       add_filter( 'the_content', 'wp_bootstrap_first_paragraph' );
       ```
   

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

 *  [jack randall](https://wordpress.org/support/users/theotherlebowski/)
 * (@theotherlebowski)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785524)
 * override the style in your style.css file. make p.lead have the same font size
   and weight as a non lead p tag.
 *  Thread Starter [WH646](https://wordpress.org/support/users/wh646/)
 * (@wh646)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785530)
 * Thanks, jack. I could do that, I guess, but is there a way to just remove the
   functionality altogether?
 * My concern is that, say, I want to style <p> later on, I then have to go do the
   same to p.lead, and it just seems bloated to do it twice. I don’t want to have
   a class that is essentially useless.
 * Any advice on removing the function?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785534)
 * Have you seen remove_filter [http://codex.wordpress.org/Function_Reference/remove_filter](http://codex.wordpress.org/Function_Reference/remove_filter)?
 *  [jack randall](https://wordpress.org/support/users/theotherlebowski/)
 * (@theotherlebowski)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785537)
 * you’d only be affecting the p tags that the function adds the class of lead to.
   all other p tags on the site would be untouched by this.
 * if you should want to make a change to ALL p tags including the p.lead tags then
   you just use
 *     ```
       p, p.lead
       {
         changes go here;
       }
       ```
   
 * and that will override the settings you previously added to p.lead.
 * i recommend not poking about in functions.php files in general. if in doubt and
   you absolutely must get rid of it contact the theme’s developer and ask them 
   for direct advice as it’s their code and they can tell you if it will knock anything
   else out of whack.
 *  Thread Starter [WH646](https://wordpress.org/support/users/wh646/)
 * (@wh646)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785539)
 * Thanks, Andrew. I had tried `remove_filter( 'the_content', 'wp_bootstrap_first_paragraph');`
   but no luck. What else do I need in there?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785546)
 * Try adding a priority as a third parameter too
 *  Thread Starter [WH646](https://wordpress.org/support/users/wh646/)
 * (@wh646)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785549)
 * Thanks, Andrew. Gave it a priority of 1 and no luck. Anything else? Much appreciated.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785554)
 * Is your child theme functions.php file being read? Have you tried adding other
   stuff?
 *  Thread Starter [WH646](https://wordpress.org/support/users/wh646/)
 * (@wh646)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785574)
 * Yea, I’ve used the child theme functions.php to enque the style.css from the 
   parent theme. That’s working fine.
 *  Thread Starter [WH646](https://wordpress.org/support/users/wh646/)
 * (@wh646)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785596)
 * Ah. Added a new function to remove it. This worked:
 *     ```
       function magic_remove_lead_paragraph($content) {
           global $post;
           return preg_replace('/<p([^>]+)?>/', '<p$1 class="something_else">', $content, 1);
       }
       add_filter('the_content', 'magic_remove_lead_paragraph');
       ```
   
 * Found solution here: [https://wordpress.org/support/topic/theme-wp-bootstrap-how-to-remove-the-lead-formatting-on-every-page?replies=5](https://wordpress.org/support/topic/theme-wp-bootstrap-how-to-remove-the-lead-formatting-on-every-page?replies=5)

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

The topic ‘Remove function from child theme’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 3 participants
 * Last reply from: [WH646](https://wordpress.org/support/users/wh646/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/remove-function-from-child-theme/#post-5785596)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
