Community Forums › Forums › Archived Forums › General Discussion › Utility bar in Streamline Pro
Tagged: lifestyle Pro, utility bar
- This topic has 9 replies, 2 voices, and was last updated 8 years, 10 months ago by Ginger.
-
AuthorPosts
-
June 30, 2015 at 1:25 pm #157963rfichtingerMember
Hello,
I'm trying to add a utility bar above the header area in The Streamline Pro theme. I don't know much about code so I tried to use Carrie Dils tutorial: http://www.carriedils.com/widget-area-above-header-genesis/
Not sure why it's not above my header area.
Any thoughts?
Thanks,
http://development.robertfichtinger.com/
BobJune 30, 2015 at 3:21 pm #157975GingerParticipantHi Bob,
Did you put this on the genesis_before_header hook? It looks like it could be on the after_header along with your primary navigation menu?
@gscoolidge | Support Nerd | Website Producer/Tweaker | IDX Integrations | Hosting Options
June 30, 2015 at 4:06 pm #157986rfichtingerMemberGinger,
I just updated the functions file and it's still the same.
Any other thoughts?
Thanks,
BobJune 30, 2015 at 5:28 pm #157989GingerParticipantHi Bob,
Well now it's moved down another position, hmm, can you send the code that you've added to your functions.php file so I can have a look? Also include any remove/add action entries for your navigation changes since it's different in the theme demo. Regarding the theme, just an FYI the link of the site is for the LIfestyle Pro theme, not the Streamline Pro theme .
@gscoolidge | Support Nerd | Website Producer/Tweaker | IDX Integrations | Hosting Options
June 30, 2015 at 5:40 pm #157991rfichtingerMemberGinger,
Thanks for your help!
Here is the functions.php code:
<?php
//* Start the engine
include_once( get_template_directory() . '/lib/init.php' );//* Setup Theme
include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' );//* Set Localization (do not remove)
load_child_theme_textdomain( 'lifestyle', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'lifestyle' ) );//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', __( 'Lifestyle Pro Theme', 'lifestyle' ) );
define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/lifestyle/' );
define( 'CHILD_THEME_VERSION', '3.1' );//* Add HTML5 markup structure
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );//* Add viewport meta tag for mobile browsers
add_theme_support( 'genesis-responsive-viewport' );//* Enqueue Scripts
add_action( 'wp_enqueue_scripts', 'lifestyle_load_scripts' );
function lifestyle_load_scripts() {wp_enqueue_script( 'lifestyle-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_style( 'dashicons' );
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Droid+Sans:400,700|Roboto+Slab:400,300,700', array(), CHILD_THEME_VERSION );
}
//* Add new image sizes
add_image_size( 'home-large', 634, 360, TRUE );
add_image_size( 'home-small', 266, 160, TRUE );//* Add support for custom background
add_theme_support( 'custom-background', array(
'default-image' => get_stylesheet_directory_uri() . '/images/bg.png',
'default-color' => 'efefe9',
) );//* Add support for custom header
add_theme_support( 'custom-header', array(
'header_image' => '',
'header-selector' => '.site-title a',
'header-text' => false,
'height' => 91,
'width' => 263,
) );//* Add support for additional color style options
add_theme_support( 'genesis-style-selector', array(
'lifestyle-pro-blue' => __( 'Lifestyle Pro Blue', 'lifestyle' ),
'lifestyle-pro-green' => __( 'Lifestyle Pro Green', 'lifestyle' ),
'lifestyle-pro-mustard' => __( 'Lifestyle Pro Mustard', 'lifestyle' ),
'lifestyle-pro-purple' => __( 'Lifestyle Pro Purple', 'lifestyle' ),
'lifestyle-pro-red' => __( 'Lifestyle Pro Red', 'lifestyle' ),
) );//* Reposition the primary navigation
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_header', 'genesis_do_nav' );//* Modify the size of the Gravatar in the author box
add_filter( 'genesis_author_box_gravatar_size', 'lifestyle_author_box_gravatar' );
function lifestyle_author_box_gravatar( $size ) {return 96;
}
//* Modify the size of the Gravatar in the entry comments
add_filter( 'genesis_comment_list_args', 'lifestyle_comments_gravatar' );
function lifestyle_comments_gravatar( $args ) {$args['avatar_size'] = 60;
return $args;}
//* Remove comment form allowed tags
add_filter( 'comment_form_defaults', 'lifestyle_remove_comment_form_allowed_tags' );
function lifestyle_remove_comment_form_allowed_tags( $defaults ) {$defaults['comment_notes_after'] = '';
return $defaults;}
//* Add support for 3-column footer widgets
add_theme_support( 'genesis-footer-widgets', 3 );//* Add support for after entry widget
add_theme_support( 'genesis-after-entry-widget-area' );//* Relocate after entry widget
remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 );//* Register widget areas
genesis_register_sidebar( array(
'id' => 'home-top',
'name' => __( 'Home - Top', 'lifestyle' ),
'description' => __( 'This is the top section of the homepage.', 'lifestyle' ),
) );
genesis_register_sidebar( array(
'id' => 'home-middle',
'name' => __( 'Home - Middle', 'lifestyle' ),
'description' => __( 'This is the middle section of the homepage.', 'lifestyle' ),
) );
genesis_register_sidebar( array(
'id' => 'home-bottom-left',
'name' => __( 'Home - Bottom Left', 'lifestyle' ),
'description' => __( 'This is the bottom left section of the homepage.', 'lifestyle' ),
) );
genesis_register_sidebar( array(
'id' => 'home-bottom-right',
'name' => __( 'Home - Bottom Right', 'lifestyle' ),
'description' => __( 'This is the bottom right section of the homepage.', 'lifestyle' ),
) );/** Reposition header outside main wrap */
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
remove_action( 'genesis_header', 'genesis_do_header' );
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 ) ;add_action( 'genesis_before', 'genesis_header_markup_open', 5 );
add_action( 'genesis_before', 'genesis_do_header' );
add_action( 'genesis_before', 'genesis_header_markup_close', 15 );/** Reposition footer outside main wrap */
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 ) ;add_action( 'genesis_after', 'genesis_footer_markup_open', 5 );
add_action( 'genesis_after', 'genesis_do_footer' );
add_action( 'genesis_after', 'genesis_footer_markup_close', 15 );/** Register Utility Bar Widget Areas. */
genesis_register_sidebar( array(
'id' => 'utility-bar-left',
'name' => __( 'Utility Bar Left', 'theme-prefix' ),
'description' => __( 'This is the left utility bar above the header.', 'theme-prefix' ),
) );genesis_register_sidebar( array(
'id' => 'utility-bar-right',
'name' => __( 'Utility Bar Right', 'theme-prefix' ),
'description' => __( 'This is the right utility bar above the header.', 'theme-prefix' ),
) );add_action( 'genesis_before_header', 'utility_bar' );
/**
* Add utility bar above header.
*
* @author Carrie Dils
* @copyright Copyright (c) 2013, Carrie Dils
* @license GPL-2.0+
*/
function utility_bar() {echo '<div class="utility-bar"><div class="wrap">';
genesis_widget_area( 'utility-bar-left', array(
'before' => '<div class="utility-bar-left">',
'after' => '</div>',
) );genesis_widget_area( 'utility-bar-right', array(
'before' => '<div class="utility-bar-right">',
'after' => '</div>',
) );echo '</div></div>';
}
June 30, 2015 at 8:05 pm #157999GingerParticipantHi Bob,
Ok, I think I see whats going on, I didn't realize you'd moved the header and footer outside of the main wrap. In looking at another post from Carrie on this topic, she gives an example of how to move something above the now-disconnected header, so give this a try with your new utility bar -- it's just removing one word
add_action( ‘genesis_before’, ‘utility_bar’ );
One other pro-tip....there is a great plugin called Query Monitor that shows you a bunch of geeky stuff :-), but the most useful might be the action hooks and what is loading where.
@gscoolidge | Support Nerd | Website Producer/Tweaker | IDX Integrations | Hosting Options
June 30, 2015 at 8:59 pm #158003rfichtingerMemberGinger,
That moved it up : ) Any other thoughts on how to get it above the header and not part of it.
Thanks for all your time on this!
- Bob
July 1, 2015 at 9:22 am #158041GingerParticipantHey at least it's moving! 🙂 Try giving it a lower priority....when you load multiple things on the same hook you need to give it a lower number (default priority is 10) for those items you want to show first. That Query Monitor plugin I mentioned can tell you what is loading where.
Your code in functions.php that is repositioning the header:
add_action( ‘genesis_before’, ‘genesis_header_markup_open’, 5 ); add_action( ‘genesis_before’, ‘genesis_do_header’ ); add_action( ‘genesis_before’, ‘genesis_header_markup_close’, 15 );
Has 5 as the lowest so I bet the utility bar is loading at the default of 10 and squeezing in before the markup close at 15. Again that Query Monitor output would tell you for sure.
So, I would try this to move the utility bar above the header:
add_action('genesis_before', 'utility_bar', 2 );
@gscoolidge | Support Nerd | Website Producer/Tweaker | IDX Integrations | Hosting Options
July 1, 2015 at 10:13 am #158052rfichtingerMemberGinger,
That worked!!! Thanks for all of your help! You have went far beyond your call of duty...
Thanks,
BobJuly 1, 2015 at 10:32 am #158054GingerParticipantMy pleasure Bob, maybe you can pay it forward if you see a question you might be able to answer 🙂
@gscoolidge | Support Nerd | Website Producer/Tweaker | IDX Integrations | Hosting Options
-
AuthorPosts
- The topic ‘Utility bar in Streamline Pro’ is closed to new replies.