WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to replace an action in a theme with my own version in a child. In this case, the theme hooks into wp_head to add it's own links. My own functions.php resides in the child theme and looks like this:

global $SMTheme;
remove_action('wp_head', array($SMTheme, 'headtext'));
add_action('wp_head', 'custom_headtext');

Unfortunately, it's not working yet and I'm fairly new to this. This is how the theme adds it's action:

class SMTheme {
  var $options;

  function SMTheme() {
    // some unrelated code here         
    include TEMPLATEPATH."/inc/settings.php";
    // if (current_user_can('administrator')) {}
    add_action('wp_head', array(&$this, 'headtext'));
share|improve this question
up vote 0 down vote accepted
include TEMPLATEPATH."/inc/settings.php";

is your problem.


is used by the parent theme

For child themes use


so your code will be

include STYLESHEETPATH."/inc/settings.php";

Alternatively you can use

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.