Loading custom header.php in a page via Art Direction?

Support Area Forums Foxy Loading custom header.php in a page via Art Direction?

Viewing 4 posts - 1 through 4 (of 4 total)
URL to the page in question:
  • Author
    Posts
  • #11174
    Rob
    Participant

    I have the art direction plugin you suggested for another topic. Is it possible to load a custom header.php file from a single page using that plugin?

    I do understand we are talking about stuff far beyond the scope of normal theme support. Thanks for any help!

    #11176
    Bill Robbins
    Participant

    Rob,

    That’s a good question. You can make a different header.php file to use in certain situations, but it’s not possible to load it with Art Direction. Here’s one way you could make that happen.

    1. Duplicate the header.php file and name it something like header-special.php
    2. Make the changes you’d like to have to the header file.
    3. Next decide what template will be used with this new header most. If it’s going to go on top of a page, you would edit page.php, if it’ll be on single blog posts, then use single.php.
    4. At the top of that template file that you’ve selected, replace this with:
      
      <?php get_header(); ?>
      

      with this:

    5. That will cause the header-special.php file you made to be loaded with that template.

    It’s possible to further refine that by using WordPress Conditional Tags. These let you execute code based on certain conditions. You could use them to load the new header only in certain situations. That might look like this:

    That would load the special header on the page that’s name home and the default one everywhere else.

    Hopefully that will help get you started. If you have any trouble, let me know.

    Have a great week,
    Bill

    #11206
    Rob
    Participant

    Thanks!

    #11208
    Bill Robbins
    Participant

    Anytime.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Loading custom header.php in a page via Art Direction?’ is closed to new replies.