Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two columns in header #98

Open
bassjobsen opened this issue Jan 29, 2014 · 2 comments
Open

Two columns in header #98

bassjobsen opened this issue Jan 29, 2014 · 2 comments
Labels

Comments

@bassjobsen
Copy link
Owner

How should I properly create two column for header. Left column is for the logo and the right column is for the social icons and contact.

@bassjobsen
Copy link
Owner Author

I have studied you question about to columns in the header. You can do this at the moment:

In your function.php (child theme) write:

add_action('jbst_child_settings','sample_jbst_child_settings');
function sample_jbst_child_settings()
{
    define('navbar_background_color','');
    define('logo_image_position','outside-nav');
    define('logo_image', get_stylesheet_directory_uri().'/logo.png');
}   

function jbst_logooustside_theme()
{
    return get_template_part( 'content', 'beforeheader');
}

add_filter('jbst_logooustside','jbst_logooustside_theme');

return get_template_part( 'content', 'beforeheader'); calls a template content-beforeheader.php:

<?php
$extraclasses = apply_filters('jbst_logooustside_classes',array());
?>
<div class="container">
    <div class="row">
        <div class="<?php echo JBST_GRIDPREFIX; ?>6 logo-outside-nav container <?php echo (($extraclasses)?' '.implode('',$extraclasses):'')?>"><?php echo jbst_logo(); ?></div>
        <div class="<?php echo JBST_GRIDPREFIX; ?>6">socialmedia</div>
    </div>
</div>

Does this make sense for you? Please let me know.

Note the current header.php calls jbst_header, with:

//in jbst-header-functions.php

 * @hooked jbst_doc_type - 9 
 * @hooked jbst_doc_title - 20 
 * @hooked jbst_head_after - 30 
 * @hooked jbst_body_open - 40 
 * @hooked jbst_main_navbar - 50 
 * @hooked jbst_top_content_wrapper - 60

So in an alternative solution will be to do:

add_action('jbst_header','extrarow',45);
function extrarow()
{
    return '<div></div>';
       // or
       // return get_template_part( 'content', 'beforeheader');
}

Good question! Helps me too. I realize now we need more specific header hooks in future versions.

@bassjobsen
Copy link
Owner Author

The header should be more flexible. I found many use cases, where these two columns seems useful. But this columns should also contain optional e-commerce and login buttons.

Example of a simple header which can't build,without hooks and actions ,with the current header function:

exampleheader

@bassjobsen bassjobsen reopened this Feb 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant