Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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.