WordPress.org

Forums

Modifying Header.php in Twenty Eleven child theme, through functions.php (7 posts)

  1. redcrowdesign
    Member
    Posted 3 years ago #

    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 1000x320 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?

  2. jimmerd
    Member
    Posted 3 years ago #

    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.

  3. redcrowdesign
    Member
    Posted 3 years ago #

    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.

  4. jimmerd
    Member
    Posted 3 years ago #

    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

  5. jimmerd
    Member
    Posted 3 years ago #

  6. redcrowdesign
    Member
    Posted 3 years ago #

    Thanks a lot dude!! :D 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.

  7. redcrowdesign
    Member
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic