• Resolved jayjerome

    (@jayjerome)


    If I want to split my header.php into two files, and create a template named ‘navigation.php’ for part of it, can I then call ‘navigation.php’ from index.php with a WordPress ‘get’ template tag?

    Can it be done with something as obvious as: <?php get_navigation( );?> or do I have to do something else to cue wordpress that ‘navigation.php’ exists?

Viewing 2 replies - 1 through 2 (of 2 total)
  • All the get_something.. functions work like that because they are defined in the WP engine. Whatever is NOT a WP function – will not work.
    Which means get_navigation will never work… unless you write a function for it.
    Is there a “pattern” when would the header be called and when the navigation? In that case you can use conditionals.

    If your new file is in the theme folder, you can call it like this:
    <?php include (TEMPLATEPATH . '/yourfile-name.php'); ?>
    Use it as it is, the only thing you have to change is your own filename – don’t touch the rest!

    Thread Starter jayjerome

    (@jayjerome)

    Thanks for the advice, moshu– the TEMPLATEPATH option looks like it will work…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘calling a created template’ is closed to new replies.