Support » Themes and Templates » Problem creating P2 child theme

  • I’m trying to create a P2 child theme and am having some problems. There’s a function in p2/inc/template-tags.php that I’d like to change, but I keep getting a “cannot redeclare” error.

    I thought that once you copy a template file into the child directory that WordPress ignores the parent version? However, that doesn’t seem to be the case here.

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter scottsemple

    (@scottsemple)

    Anyone?

    Yes, it’s loading the PHP file in the main directory for the child instead of the parent’s. I had similar problems with templates that keep including other scripts from sub-directories.

    The only solution that I found so far:

    1) use a copy of the script that calls the includes the file (this only works on real template pages like header.php or index.php

    2) if it’s in functions.php, your own functions.php will be used first, then the functions.php of the parent theme will be used. In this case you can’t do much to prevent loading the template-tags.php

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem creating P2 child theme’ is closed to new replies.