ThemeShaper Forums » Thematic

[closed]

Help with adding extra image to header

(4 posts)
  • Started 3 years ago by earrame
  • Latest reply from earrame
  • This topic is not resolved

Tags:

  1. Hello, I know that this has been dealt with a few times already, but I am having trouble making it work.

    What I am trying to do is to add a "buy now" sticker to the header. I have read that I add a function in thematic header. I copied header-extensions.php to my child theme and added this function:


    // Functions that hook into thematic_header()

    // Open #branding
    // In the header div
    if (function_exists('childtheme_override_brandingopen')) {
    function thematic_brandingopen() {
    childtheme_override_brandingopen();
    }
    } else {
    function thematic_brandingopen() {
    echo "<div id=\"branding\">\n";
    }
    add_action('thematic_header','thematic_brandingopen',1);
    }

    // Create the blog title
    // In the header div
    if (function_exists('childtheme_override_blogtitle')) {
    function thematic_blogtitle() {
    childtheme_override_blogtitle();
    }
    } else {
    function thematic_blogtitle() { ?>

    <div id="blog-title"><span>/" title="<?php bloginfo('name') ?>" rel="home"><?php bloginfo('name') ?></span></div>

    <?php }
    add_action('thematic_header','thematic_blogtitle',3);
    }
    function add_stuff() {?>
    <img src="http://trampoline-bed.com/wp-content/themes/jumpybed-theme/imgs/order-sticker.png" alt="Order your jumpy bed now!" id="order-sticker" title="order-sticker" width="146" height="147" />
    <?php }

    add_action('thematic_header','add_stuff',2);
    // Create the blog description
    // In the header div

    The function I added is add_stuff.
    I then styled it with this:

    #order-sticker{
    position: absolute;
    top: 0px;
    left: 30px;
    z-index: 200;
    }

    nothing is showing up at all. Could someone show me the error I am making? The site is http://trampoline-bed.com

    Posted 3 years ago #
  2. nevermind. I figured it out.

    Posted 3 years ago #
  3. you don't need to copy everything from header-extensions.php over to your functions.php. you only need the copy the overrides that you actually wish to use.

    though it looks like you only needed:

    function add_stuff() {?>
    <img src="<?php bloginfo('stylesheet_directory');?>/imgs/order-sticker.png" alt="Order your jumpy bed now!" id="order-sticker" title="order-sticker" width="146" height="147" />
    <?php }
    
    add_action('thematic_header','add_stuff',2);
    Posted 3 years ago #
  4. Thanks, that's what I figured out. <with a palm to forehead>

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.