• Resolved jdarias

    (@jdarias)


    I want to include some static links in the parent theme′s header and a different set of links in the child theme′s header.

    Since this is the only difference between both headers, i want to use a php include in header.php to call for a specific file (let′s say nav_links.html), wich would contain the links. This way i would save myself the chore of creating two header.php for parent and child with just one line of code being different.

    I would put the file nav_links.html in the folder of the parent theme, and a different nav_links.html in the folder of the child theme.
    Then in header.php i would call it with

    <?php include 'nav_links.html'; ?>

    But it doesn′t work in the child theme: it ends up using the nav_links.html from the parent. I thought that a child theme′s file would override a file with the same name in the parent, but i guess i′m missing something (maybe in functions.php?)

    What should i do in this case to get this to work?

Viewing 1 replies (of 1 total)
  • Thread Starter jdarias

    (@jdarias)

    I think I got it sorted:
    <?php include ( STYLESHEETPATH . '/nav_global.php' ); ?>
    I switched from html to php just in case.

Viewing 1 replies (of 1 total)
  • The topic ‘How to include some static html file in a parent and child theme?’ is closed to new replies.