northumbrian
9/23/2016 - 3:52 PM

Provides a fixed (sticky) header & primary nav bar - provided by Junior Atoms: http://cobaltapps.club/forum/main-category/web-design-talk/47

Provides a fixed (sticky) header & primary nav bar - provided by Junior Atoms: http://cobaltapps.club/forum/main-category/web-design-talk/47382-what-genesis-and-dynamik-the-dynamik-duo-cant-create-a-fixed-header?p=47553#post47553

Paste the PHP in: Genesis > Dynamik Custom > Functions Paste the CSS in: Genesis > Dynamik Custom > CSS

//* Open dynamik-sticker div
add_action( 'genesis_before_header', 'dynamik_open_sticker', 2 );
function dynamik_open_sticker() {
    
    echo '<div class="dynamik-sticker">';

}

//* Close dynamik-sticker div
add_action( 'genesis_after_header', 'dynamik_close_sticker' );
function dynamik_close_sticker() {
    
    echo '</div>';

}
/* Dynamik Sticker */

body {
    padding-top: 150px; /* Equal to header plus nav heights. */
}

.dynamik-sticker {
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9999;
}

.admin-bar .dynamik-sticker {
    top: 32px;
}

/* Hide Tagline

.site-description {
    line-height: 0;
    margin: 0;
    padding: 0;
    text-indent: -9999px;
}

*/

/* Media Queries */

@media only screen and (max-width: 1140px) {
    
    body {
        padding-top: 200px; /* Equal to header plus nav heights. */
    }
    
}

@media only screen and (max-width: 782px) {

    .admin-bar .dynamik-sticker {
        top: 46px;
    }
    
}

@media only screen and (max-width: 600px) {

    #wpadminbar {
        position: fixed;
    }

}