ThemeShaper Forums » Thematic

[closed]

Move Header above wrapper in functions.php

(8 posts)
  • Started 8 years ago by robbie_nucleoid
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. robbie_nucleoid
    Member

    I am still new to the way thematic works and the theme hooks in particular but I want to move the header above the wrapper and make the wrapper 960px width but make the header 100% width and I figure the best way to do this would be to move the header out of the wrapper altogether. I am thinking something like

    function remove_header() {
        remove_action('thematic_header', 'thematic_header');
    }
    add_action('init', 'remove_header');
    // add header to its new position
    add_action('thematic_before', 'thematic_header');

    Not really sure what I am doing here but I can't find an answer anywhere.

    Could anyone help?

    Posted 8 years ago #
  2. Biofobico
    Member

    Why not leave #header with 100% width and the content 960px? Isn't the same thing?

    Posted 8 years ago #
  3. robbie_nucleoid
    Member

    Thanks for your reply,

    I would have done this but the header is inside the wrapper according to the thematic structure. If the wrapper contains the site and is set to 960px the header will be set to this width. The only way I can see to change this is to move the header out of the wrapper altogether.
    Or am I missing the point here?

    Posted 8 years ago #
  4. you could also leave the wrapper at 100%, the header at 100%, the branding at 100% and then define #main at 940px.

    your function isn't working b/c there are 5 different functions contained within thematic_header on different action hooks. this will empty out the thematic_header

    function remove_header() {
    remove_action('thematic_header','thematic_brandingopen',1);
    remove_action('thematic_header','thematic_blogtitle',3);
    remove_action('thematic_header','thematic_blogdescription',5);
    remove_action('thematic_header','thematic_brandingclose',7);
    remove_action('thematic_header','thematic_access',9);
    }
    add_action('init', 'remove_header');

    regarding putting it back above the wrapper... i am not 100% sure, since idk if you can use action hooks on thematic_before, but you could try this w/ and w/o the hook numbers.

    add_action('thematic_before','thematic_brandingopen',1);
    add_action('thematic_before','thematic_blogtitle',3);
    add_action('thematic_before','thematic_blogdescription',5);
    add_action('thematic_before','thematic_brandingclose',7);
    add_action('thematic_before','thematic_access',9);
    Posted 8 years ago #
  5. Biofobico
    Member

    I wrote; "Why not leave #header with 100% width and the content 960px?"

    http://img710.imageshack.us/i/picture1mcq.png/

    Isn't the same thing?

    Posted 8 years ago #
  6. guess robbie needs to come back and clarify what he is looking for.

    Posted 8 years ago #
  7. robbie_nucleoid
    Member

    Thanks for your comments

    In answer to Biofobico, your image conveys what I am trying to achieve and that would have worked if I hadn't already moved access to be inside #main

    If I make the wrapper 960 the header and access are also contained in the 960 width. If I move the header out of the wrapper then I can set it to 100% but the rest will be 960.

    Helgatheviking - that solution almost works except it leaves the header div inside but everything contained inside the header has been moved outside. All I need to add is the code to move the header div also.

    I tried

    function remove_header() {
    remove_action('thematic_header','thematic_header',1);
    remove_action('thematic_header','thematic_brandingopen',1);
    remove_action('thematic_header','thematic_blogtitle',3);
    remove_action('thematic_header','thematic_blogdescription',5);
    remove_action('thematic_header','thematic_brandingclose',7);
    
    }
    add_action('init', 'remove_header');
    add_action('thematic_header','thematic_header',1);
    add_action('thematic_before','thematic_brandingopen',1);
    add_action('thematic_before','thematic_blogtitle',3);
    add_action('thematic_before','thematic_blogdescription',5);
    add_action('thematic_before','thematic_brandingclose',7);

    But I know the top line is not right, just don't know what to put in its place

    Posted 8 years ago #
  8. hmmm i think the header div begins in header.php, so the effect you are going for in the first line is impossible. therefore my suggestion would be to set #header to display: none. and then wrap all the rest of it up in a different div that you could style the way you want your header to look.

    so

    function remove_header() {
    remove_action('thematic_header','thematic_brandingopen',1);
    remove_action('thematic_header','thematic_blogtitle',3);
    remove_action('thematic_header','thematic_blogdescription',5);
    remove_action('thematic_header','thematic_brandingclose',7);
    remove_action('thematic_header','thematic_access',9);
    }
    add_action('init', 'remove_header');
    
    thematic_myheaderopen() {
    echo '<div id="myheader">';
    }
    
    thematic_myheaderclose() {
    echo '</div><!--myheaderclose-->';
    }
    
    add_action('thematic_before','thematic_myheaderopen',1);
    add_action('thematic_before','thematic_brandingopen',2);
    add_action('thematic_before','thematic_blogtitle',3);
    add_action('thematic_before','thematic_blogdescription',5);
    add_action('thematic_before','thematic_brandingclose',7);
    add_action('thematic_before','thematic_myheaderclose',8);
    add_action('thematic_before','thematic_access',9);
    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.