This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Copy and paste this code in front-page.php benweiser.com | |
//* Add body class for custom CSS styles | |
add_filter( 'body_class', 'bw_home_body_class' ); | |
function bw_home_body_class( $classes ) { | |
$classes[] = 'featured-posts-home'; | |
return $classes; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register home featured posts widget area add this to functions.php | |
genesis_register_sidebar( array( | |
'id' => 'home-featured-posts', | |
'name' => __( 'Home Featured Posts', 'themename' ), | |
'description' => __( 'This is a widget area that is the home featured posts', '' ), | |
) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adds Home Featured Image Size | |
add_image_size( 'home-featured-post', 380, 380, TRUE ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.page-1-widget { | |
background:#444; | |
color:#fff; | |
margin-bottom:40px; | |
padding:40px 5%; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See if we're on the blog post home page and if there are posts | |
if ( is_home() && have_posts()) { | |
// Get what page we are on, if not assume first page. | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
if( 1 == $paged ) { | |
add_action('genesis_before_loop','bw_paged_widget'); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bw_page_1_widget(); | |
function bw_page_1_widget() { | |
genesis_register_sidebar( array( | |
'id' => 'page-1-widget', | |
'name' => __( 'Blog Archive Widget', 'themename' ), | |
'description' => __( 'This is a widget area that only appears on the first page of the blog', 'themename' ), | |
) ); | |
} | |
function bw_paged_widget(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.top-bar { | |
background-color: #fff; | |
min-height: 70px; | |
padding: 10px; | |
padding: 1rem; | |
position: fixed; | |
transition: top 0.2s ease-in-out; | |
text-align: center; | |
width: 100%; | |
z-index: 99; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
// Hide Top bar on on scroll down | |
var didScroll; | |
var lastScrollTop = 0; | |
var delta = 5; | |
var topbarHeight = $('.top-bar').outerHeight(); | |
$(window).scroll(function(event){ | |
didScroll = true; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' ) | |
); | |
} |