WordPress.org

Support

Support » Themes and Templates » Modifying Header.php in Twenty Eleven child theme, through functions.php

Modifying Header.php in Twenty Eleven child theme, through functions.php

  • Hi, I am new to this forum and kinda new to WordPress as well. I do understand PHP basics and some CSS but my forte is design and animation.

    Here’s my problem:
    I made look this website really nice but now the owner wants the new Twenty Eleven theme. Everything went easy until I bumped into the header. All I need to know is what code I need in my functions.PHP to replace all there is in the header with A single 1000×320 animated flash movie. I’m currently using Kimili Flash Embed, if that helps.

    I’ve read pretty much all there is to know about it looking for tutorials, I understand how it’s done and I understand how it works but understanding is only half the battle. I need to know how to code it. Which for the life of me I just can’t. I suck at PHP. All I’ve done so far is copy-pasting code chunks for everything code-related. Except of course HTML and CSS, which as you know are obsolete by now.

    Can anyone help me with this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Well, why functions? Why not edit the header.php

    Is it the same flash movie on all pages? (If you want a featured image as Flash, that’s beyond me, but likely doable.)

    First things first: You know it’s best NOT to edit the theme proper? Instead create a child theme. Search the codex for this if you don’t know. It ensures that when TwentyEleven gets updated, it doesn’t wipe out what you’ve done.

    Then save a copy of header.php from TwentyEleven into your child theme folder and edit it. Header image info is lines 78-97 in the version I’m looking at. Replace it with the embed code for your flash movie and you should be good to go.

    Hello, thanks for the answer. I’d rather stay away from the original files. The last time I altered the original files the template was rendered buggy with subsequent updates. That is why I decided to go with functions.php, in a Child theme. And yes, I do know about child themes. And I know that the child’s header.php will completely replace the parent’s and when an update comes the header.php won’t be updated. I mean, yes, the parent’s will, but the child’s header won’t so it’ll be like updating everything but the header. What’s the point then? While with functions.php the child overrides or adds to the parent’s. Which is what I want.

    OK, so you want a hook or two to remove the header image and then add new code to embed the SWF there?
    Not sure how to do that.

    Link that might help:
    http://phpdoc.wordpress.org/trunk/WordPress/Twenty_Eleven/_wp-content—themes—twentyeleven—functions.php.html

    Thanks a lot dude!! 😀 The first link was like “chinese” to me but the second one is a bit more understandable. But still it does not explain how to add SWF’s, just plain images. I’m trying to figure that out but it ain’t working. And I need to get rid of the search bar and the menu that comes with the default installation of wordpress too. Or at least the just menu, ’cause my header SWF already has a nice animated menu, I don’t mind *a lot* the search field. Thanks again, man.

    Problem fixed. Had to hire a PHP programmer LOL. Thanks anyways.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Modifying Header.php in Twenty Eleven child theme, through functions.php’ is closed to new replies.