Skip to content

Instantly share code, notes, and snippets.

@benweiser
Created June 15, 2015 23:31
Show Gist options
  • Select an option

  • Save benweiser/0f874722205508afa3a5 to your computer and use it in GitHub Desktop.

Select an option

Save benweiser/0f874722205508afa3a5 to your computer and use it in GitHub Desktop.
Sticky Top Bar Widget Reveal Functions.php
// Sticky top bar that hides on scroll down, reveals on scroll up
// Benweiser.com
function bw_sticky_bar() {
wp_enqueue_script(
'bw-sticky-bar',
get_stylesheet_directory_uri() . '/js/stickybar.js',
array( 'jquery' )
);
}
add_action( 'wp_enqueue_scripts', 'bw_sticky_bar' );
bw_register_top_bar();
function bw_register_top_bar() {
genesis_register_sidebar( array(
'id' => 'top-bar',
'name' => __( 'Top Bar', 'themename' ),
'description' => __( 'This is a widget area that is the top bar', 'themename' ),
) );
}
add_action('genesis_before', 'bw_hook_top_bar');
function bw_hook_top_bar(){
genesis_widget_area( 'top-bar', array(
'before' => '<div class="top-bar widget-area"><div class="wrap">',
'after' => '</div></div>',
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment