Forums

Adding DIV to TwentyTen Child Theme w/CSS & functions.php (7 posts)

  1. BRIXBOSTON
    Member
    Posted 1 year ago #

    I have a TwentyTen Child theme.

    I have made the margin at the top of the page bigger using css.

    Is there a way I can add images here using CSS and functions.php without altering the parent theme?

    I would like to put a DIV there with a few image links, text links, etc.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    If you don't want to change the parent theme, you would need to create and use a child theme that contained your amendments.

  3. BRIXBOSTON
    Member
    Posted 1 year ago #

    Hi Esmi. Cool avatar!

    I have already created and use a Child Theme.

    I am wondering if this is possible without creating a header.php in my child theme and amending the DIV manually.

    Can it be done in TwentyTen using a Plugin API Hook and functions.php?

    <?php
    
    function icons_div() {
        echo '<div id=icons></div>' . "\n";
    }
    add_action('wp_head', 'icons_div');
    
    ?>

    ^^^ But I cannot put a <DIV> in wp_head.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You don't want to touch wp_head(). It doesn't output your header but is used by the core and as a hook for plugins etc.

    The easiest way to achieve what you're after is to copy the 2010 header.php file into your child theme and then start amending anything from <div id="header"> down to </div><!-- #header --> as appropriate.

  5. BRIXBOSTON
    Member
    Posted 1 year ago #

    I didn't want to mess with wp_head()
    I was wondering if there was another theme hook in TwentyTen other than wp_head

    Thanks for the help btw.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Not that you can use to add additional images and/or a <div></div> to the header markup.

  7. RoyCreative
    Member
    Posted 11 months ago #

    BRIX, check out thematic, I think it provides more action hooks and will be easier to manipulate for you.

Topic Closed

This topic has been closed to new replies.

About this Topic