ThemeShaper Forums » Thematic

[closed]

Question about removing code from header

(5 posts)
  • Started 2 years ago by elizabethr4
  • Latest reply from elizabethr4
  • This topic is not resolved
  1. Hi all,
    I'm new to Thematic, but so far doing okay at making a static site (http://www.buunnicoffee.com/) into a Wordpress site: http://buunnicoffee.com/testing2/

    I have two different headers, one for the home page (header-home.php) and one for the subpages (header.php). I successfully implemented this, and it's actually working as I want it to (yay!) but I took out a bit of code from the header file and I don't know if it will mess me up later.

    Basically, I couldn't understand how/where to add my desired html (not just images, but live text too) into my new header-home.php file in my child theme. I didn't know how to differentiate the two headers in the functions file, if necessary. Anyway, so I just thought, let me just add my html and see what happens - and it worked!

    BUT - I took out the following from my new header file:

    <div id="header">

    <?php

    // action hook creating the theme header
    thematic_header();

    ?>

    </div>

    And put in:

    <div id="header2">
    all my html code
    </div>

    As I said, it's working fine - but is taking out that bit of php going to cause me a problem later?

    I didn't want it to get the other header, but maybe there's something that should go in the functions.php file for this template page where the second header is called?

    Any insight would be greatly appreciated!

    Posted 2 years ago #
  2. Sorry, I don't have backticks on my keyboard - the code is supposed to be highlighted. Thanks!

    Posted 2 years ago #
  3. Nice job on getting the sites to match up.

    It looks like you moved the #access menu outside the header which is smart. That would of been the one thing I would have suggested, but you already took care of that.

    Really there are no issues you have to worry about. There are other ways to do it where you could do it all through your functions.php file, but in this case I can't think of a reason to do that if you already have it working correctly.

    Posted 2 years ago #
  4. Thanks for taking a look!

    That was my dilema - should it be done through functions.php - but I was unsure of how to specify/differentiate the two page templates with the two headers (page.php with header.php and page-template-home.php with header-home.php) in the code in the functions file. Seemed a little over my head, so I took the "easy" way out. Just wanted to make sure that cutting a little PHP:

    thematic_header();

    wouldn't cause an issue later.

    Next time, I'll try to learn more about using functions.php! Thanks!

    Posted 2 years ago #
  5. Follow up questions (and I will mark this resolved):
    What is the advantage of doing those sorts of changes (different html for a second header file) through the functions.php file over just writing the html in the header file?

    And second, where does the html mark up go? In the code in the functions.php file? I know of many changes that can be made through CSS, but if there's a paragraph of live text, with a link, into which file does that code go?

    Thanks, just trying to understand more about Thematic overall!

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.