Cameron
Cameron

Reputation: 1

WordPress Child Theme

I use the following code in my Single.php file to grab show a different single template file based on what the user is viewing.

<?php
    if (in_category('Portfolio')) {
        include (TEMPLATEPATH . '/single-work.php');
    }
    elseif (in_category('Blog')) {
        include (TEMPLATEPATH . '/single-blog.php');
    }
?>

The problem is that I am using Child Themes and therefore it will try to include files from the parent theme instead of the child theme. How do I get it to include from the child theme instead?

Upvotes: 0

Views: 330

Answers (1)

Richard M
Richard M

Reputation: 14535

Confusingly you have to use STYLESHEETPATH instead of TEMPLATEPATH.

Upvotes: 1

Related Questions