• Hello all,

    Searches haven’t brought me any clear insight on this.

    So, I am trying to add category specific “single.php” pages in my child theme.

    Basic process I am following is putting the following in single.php file, then creating the referred files.

    <?php
    
    $post = $wp_query->post;
    
    if ( in_category('3') ) {
    
      include(TEMPLATEPATH. 'C:/wamp/www/wordpress/wp-content/themes/My-Child-Theme/single-articles.php'); } 
    
    elseif ( in_category('8') ) {
    
      include(TEMPLATEPATH. 'C:/wamp/www/wordpress/wp-content/themes/My-Child-Theme/single-sys.php'); } 
    
    else {
    
      include(TEMPLATEPATH. 'C:/wamp/www/wordpress/wp-content/themes/My-Child-Theme/single-default.php');
    
    }
    
    ?>

    I dropped this in, to return the path and it always returns the main theme directory. I thought trying to guide the path with the full directory would fix it, but to no avail.

    <?php echo TEMPLATEPATH; ?>

    If anyone has a link or idea for where to go next to resolve this it would be appreciated!

    Thanks for your time,

    Nimo1

  • The topic ‘Main theme over riding 'templatepath' in child theme?’ is closed to new replies.