Title: Child Theme &#8211; Overwrite parent function
Last modified: August 21, 2016

---

# Child Theme – Overwrite parent function

 *  [bpjdotdk](https://wordpress.org/support/users/bpjdotdk/)
 * (@bpjdotdk)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/child-theme-overwrite-parent-function/)
 * Hi I want to overwrite a function in the parent theme.
 * **Parent Theme (esplanade)**
 * I have created a child theme, but cannot make the overwrite function work.
    I
   know that the child function.php is loaded first, and there for should by able
   to overwrite the parent function just by declaring in the child theme, if the
   function_exists() is use in the parent theme, which it is in this case.
 * **Child Theme (esplanade-child)**
 *     ```
       # child theme function.php
   
       if ( ! function_exists( 'child_esplanade_theme_setup' ) ) :
       function child_esplanade_theme_setup() {
       /* do some thing*/
       }
   
       function remove_parent_esplanade_theme_setup() {
           remove_action( 'after_setup_theme', 'esplanade_theme_setup' );
           add_action( 'after_setup_theme', 'child_esplanade_theme_setup' );
       }
   
       add_action( 'after_setup_theme', 'remove_parent_esplanade_theme_setup' );
       ```
   
 * Can anyone explain to me why this won’t work. I have tryed other thing as well.

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

 *  [liton1980](https://wordpress.org/support/users/liton1980/)
 * (@liton1980)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/child-theme-overwrite-parent-function/#post-4182962)
 * Did you make the child theme in the right way? I suggest you to use “Orbisius
   Child Theme Creator” plugin for making child theme from your current themes and
   see if your problem persists?
 *  Thread Starter [bpjdotdk](https://wordpress.org/support/users/bpjdotdk/)
 * (@bpjdotdk)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/child-theme-overwrite-parent-function/#post-4182972)
 * style.css
 *     ```
       /*
       Theme Name: Child Theme
       Theme URI: http: //domain.com/
       Description: This is a custom child theme.
       Author: name
       Author URI: http: //domain.com/about/
       Template: esplanade
       Version: 0.1
       */
   
       /* =Imports styles from the parent theme
       -------------------------------------------------------------- */
       @import url("../esplanade/style.css");
   
       /* =Theme customization starts here
       -------------------------------------------------------------- */
       ```
   
 * Do you mean like this?
 * The “Orbisius Child Theme Creator” did not help me at all:(
 *  [liton1980](https://wordpress.org/support/users/liton1980/)
 * (@liton1980)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/child-theme-overwrite-parent-function/#post-4183015)
 * Yes,i meant that. Have you read wordpress codex about using functions.php for
   child themes? Please have a look at it here. maybe it helps you: [http://codex.wordpress.org/Child_Themes#Using_functions.php](http://codex.wordpress.org/Child_Themes#Using_functions.php)
 *  Thread Starter [bpjdotdk](https://wordpress.org/support/users/bpjdotdk/)
 * (@bpjdotdk)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/child-theme-overwrite-parent-function/#post-4183229)
 * Yes I have read this, but didnt help.
 * how can I check if the child theme functions.php is loaded?
 *  [ronangelo](https://wordpress.org/support/users/ronangelo/)
 * (@ronangelo)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/child-theme-overwrite-parent-function/#post-4183230)
 * Make your action load after the original has been added.
 *     ```
       add_action( 'after_setup_theme', 'remove_parent_esplanade_theme_setup', 20 );
       ```
   
 *  Thread Starter [bpjdotdk](https://wordpress.org/support/users/bpjdotdk/)
 * (@bpjdotdk)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/child-theme-overwrite-parent-function/#post-4183280)
 * Tryed that:(

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

The topic ‘Child Theme – Overwrite parent function’ is closed to new replies.

## Tags

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

 * 6 replies
 * 3 participants
 * Last reply from: [bpjdotdk](https://wordpress.org/support/users/bpjdotdk/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/child-theme-overwrite-parent-function/#post-4183280)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
