WordPress.org

Ready to get started?Download WordPress

Forums

Problem creating P2 child theme (3 posts)

  1. scottsemple
    Member
    Posted 3 years ago #

    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?

  2. scottsemple
    Member
    Posted 3 years ago #

    Anyone?

  3. heddesheimer
    Member
    Posted 3 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic