ThemeShaper Forums » Thematic

Add Divs (content) in Branding Area in Child Theme

(15 posts)
  • Started 12 years ago by sfrangos
  • Latest reply from Chris
  • This topic is resolved

Tags:

  1. Hello -

    Great theme, and great help -- thanks. I have been reading the forum and saw a couple of posts where you were asked about adding content in the branding area. The reply was to use a child theme (got the concept... great), and then a moderator spoke about functions that define the header:

    The following functions define the header:

    thematic_brandingopen()
    thematic_blogtitle()
    thematic_blogdescription()
    thematic_brandingclose()
    thematic_access()

    All are located in thematic/library/extensions/hooks-filters.php

    Ok. But that does not answer the specific question which is: Using a child theme, what are the specific steps to take to add a div with content (say a telephone number, maybe a search box, etc.) to the branding area? Is it done in the functions? Functions plus a child header.php? Where are the divs and content actually inserted?

    Thanks. I would like to make a contribution in the spirit of the GPL and open source to support this work... where do I do that?

    - Scott

    Posted 12 years ago #
  2. Scott,

    could you please give me some more details .. where should this new div be located?

    - in #branding
    - outside of #branding

    Cheers,

    Chris

    Posted 12 years ago #
  3. Hello Chris -

    After reading the blog about action hooks, and then the wiki list of Theme Hooks for Thematic, I think I can get my question to the next level for you all:

    I now understand how to use an Action Hook to add content, and have written one like this:

    // First we make our function
    function childtheme_contact_blurb() {
    
    { ?>
    
    <!-- our welcome blurb starts here -->
    <div id="header-contact">
    Phone No.: 000.000.0000
    
    </div>
    <!-- our welcome blurb ends here -->
    <?php }
    
    } // end of our new function childtheme_welcome_blurb
    
    // Now we add our new function to our Thematic Action Hook
    add_action('thematic_header','childtheme_contact_blurb');
    
    ?>

    Add function. Add HTML. Place it via where you add it (in this case, thmatic_header). But it is the last point where I can use your help... I would like to have it after the blog description and before the branding close actions. How do I add it there?

    Thanks -
    Scott

    Posted 12 years ago #
  4. .. you were faster .. will be back in a couple of minutes with some code

    Posted 12 years ago #
  5. .. add the following code to your child theme's functions.php:

    function additional_header_content() {
    // your stuff goes inside here
    }
    add_action('thematic_header', 'additional_header_content', 6);

    If you take a look at the Theme Hooks, using prio 6 will place your action right between thematic_blogdescription() and thematic_brandingclose().

    Cheers,

    Chris

    Posted 12 years ago #
  6. Hi Chris -

    Great stuff! Where do I make a donation to support the effort?

    - Scott

    Posted 12 years ago #
  7. .. you could buy the PowerBlog Theme :-)

    Cheers,

    Chris

    Posted 12 years ago #
  8. Hi Chris -

    Thanks - I do plan to purchase the PowerBlog Theme.

    Now I have a related problem in building a child theme with my newly created child theme with action hook in it. In a nutshell, when I include the new action hook, the Blog Description div appears lower on the Home and Blog page, but not on regular pages.

    • Here's an example of the home page with description lower
    • Here's an example of the about page with description higher
    • Note, while inspecting each page, I saw that on the home and blog page, the description is wrapped in an h1, but on the other pages it is not. Even so, I have not been able to take control of it (remove padding, margins) in CSS. Is the h1 tag added by Thematic to those page for SEO purposes?
    • I thought perhaps my code in the functions file could be the culprit (modified a bit since we reviewed it above), but cannot see any problems:
      // First we make our function
      function childtheme_contact_blurb() {
      
      { ?>
      
      <!-- our contact blurb starts here -->
      <div id="header-contact">
      Contact: 000.000.0000
      
      <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
      <input type="text" size="put_a_size_here" name="s" id="s" value="Search here" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/>
      <input type="submit" id="searchsubmit" value="Search" class="btn" />
      </form>
      
      </div>
      <!-- our contact blurb ends here -->
      <?php }
      
      } // end of our new function childtheme_contact_blurb
      
      // Now we add our new function to our Thematic Action Hook
      add_action('thematic_header','childtheme_contact_blurb', 2);
      
      ?>

    Your help will be appreciated.

    Scott

    Posted 12 years ago #
  9. Scott,

    have you tried to add your function with prio 6? In this case #header-contact would be parallel to #branding and shouldn't interfere with the blog description.

    Cheers,

    Chris

    Posted 12 years ago #
  10. Hi Chris -

    Thanks for the prompt response. Hey, I did buy the PowerBlog theme and plan to keep working closely with you guys. That is a good one.

    Yes... I started with it in prio 6, then tried each of the others and had the same problem. That current position -- 2, is the last one I tried with the same result.

    To help troubleshoot, see a comparative screenshot with firebug inspection showing the odd inclusion of the h1 tag (child theme does not call for it) in the description - HERE.

    Your help is much appreciated -- would like to solve this one and understand the problem.

    - Scott

    Posted 12 years ago #
  11. .. will do some tests later this evening.

    Posted 12 years ago #
  12. Hi Chris -

    I wondered if you saw the same thing when you did a test?

    Thanks -
    Scott

    Posted 12 years ago #
  13. Hi Scott,

    .. my fault .. meant prio 8 .. This is what I did here:

    #branding {
      float: left;
      width: 620px;
    }
    #header-contact {
      float: right;
      width: 320px;
      padding: 88px 0 44px;
    }
    
    /* This will clear the floats and keeps the access bottom line
    from jumping into the air */
    #access {
      clear: both;
    }

    Using these settings the blog description will stay where it should be.

    You still need to adjust the left padding / margin for #branding.

    Cheers,

    Chris

    Posted 12 years ago #
  14. Hi Chris -

    Thanks. Visited your site, but did not see how to contact you there. Have some possible work for you... how do we connect?

    - Scott

    Posted 12 years ago #
  15. Scott,

    send a mail to chris (at) wupperpiraten (dot) de. Depending on the internet connection it could take me a while to answer. I'm currently on tour with our mobile home. Will be back on Sunday.

    Cheers,

    Chris

    Posted 12 years ago #

RSS feed for this topic

Reply

You must log in to post.