Support » Developing with WordPress » Relative path to child theme custom page template

  • Resolved Carlos Pereira

    (@enrique71)


    Where is the pathname base for a child theme declared?

    I’m trying to call a custom header template part from my own template twentytwentyone-child/front-page.php like this:

    
    get_header( 'template-parts/header/front-page-site-header' );
    

    but it’s clear that WordPress is using the twentytwentyone/ (parent) theme folder as its base, so it thinks I want twentytwentyone/template-parts/header/front-page-site-header.php.

    I could navigate to the child theme folder within my get_header() parameter, but what’s the “correct” way to do that? Do I somehow need to use get_theme_file_uri() or get_theme_file_path()?
    TIA

    • This topic was modified 7 months, 1 week ago by Carlos Pereira.
    • This topic was modified 7 months, 1 week ago by Carlos Pereira.
    • This topic was modified 7 months, 1 week ago by Carlos Pereira.
    • This topic was modified 7 months, 1 week ago by Carlos Pereira. Reason: Trying to link to a Developers documentation page with markdown... guess that's not allowed
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Relative path to child theme custom page template’ is closed to new replies.