WordPress.org

Ready to get started?Download WordPress

Forums

need to call a custom .php file in my header (using a child theme) (4 posts)

  1. js09
    Member
    Posted 3 years ago #

    basically i need to add this to my header:

    <?php include("main_nav_links.php"); ?>

    but i'm using a child theme. should I just modify header.php instead?

  2. Close but not quite. There is probably a better way to do it, but copy the header.php from the parent directory into the child directory.

    Modify that copy and you'll be all set.

  3. js09
    Member
    Posted 3 years ago #

    Right now that's what i'm doing, however when wordpress updates in the future, i'll have to replace the entire header.php

    is there way to use my child theme functions.php to inject the additional php file information?

  4. It really depends on what you want to add. If you can do so via wp_header() then you can add just that via your functions.php file for your child theme.

    If you really want to dramatically change the output of header.php, then you'll need to keep your own copy and modify that one.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.