Community Forums › Forums › Archived Forums › Design Tips and Tricks › Agency Pro static header and menu bar
Tagged: agency pro
- This topic has 12 replies, 2 voices, and was last updated 10 years, 4 months ago by mikemueller.
-
AuthorPosts
-
December 12, 2013 at 10:44 am #78560mikemuellerParticipant
Working on a site using Agency Pro and would like to keep the header and the menu bar static (top of page).
I'd also like move the header image off the menu bar.Here's the temp site http://69.175.87.226/~runandge/
Help?
http://69.175.87.226/~runandge/
🙂
MMDecember 12, 2013 at 11:21 pm #78732nutsandboltsMemberTry adjusting the padding for .site-container - that will help move your nav down where it isn't running into the header.
You can make the logo and nav static by changing .nav-secondary to this:
.nav-secondary { background-color: #444; position: fixed; width: 100%; z-index: 999; }
However, I'm not sure you'll like the way the content scrolls behind it, so you might want to take note of all the style rules before you make changes (in case you decide to change it back).
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 13, 2013 at 11:12 am #78827mikemuellerParticipantAwesome Andrea! Thanks! That made both static but...
Now I need to lower the menu bar enough to get the logo to show OR better yet - put the menu bar at the top above the logo.
How do I do that?December 13, 2013 at 11:14 am #78828nutsandboltsMemberSorry if I misunderstood - you said "would like to keep the header and the menu bar static" so I assumed you wanted both.
You can move the navigation above the header by adding this to functions.php:
//* Reposition the secondary navigation menu remove_action( 'genesis_after_header', 'genesis_do_subnav' ); add_action( 'genesis_before_header', 'genesis_do_subnav' );
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 13, 2013 at 11:25 am #78834mikemuellerParticipantOh no, it's not you, it's me!
😉I do want to keep both static. But I need the logo to show and not hide behind the menu bar (or layered on top of it).
I just added your snippet to the bottom of the functions.php for the child theme (via ftp), didn't change anything above it in the file. No change - what did I miss?
* and I really, really appreciate the help! You rock!
MMDecember 13, 2013 at 11:26 am #78835nutsandboltsMemberDid you try increasing the padding on
.site-container
in your stylesheet? That should get the logo off the menu. I think I had to use about 11rem in Firebug to get it to clear completely.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 13, 2013 at 11:41 am #78841mikemuellerParticipantJust did that and we're looking better.
Went with
.site-container {
padding-top: 140px;
padding-top: 14rem;
}Any idea on why the menu bar isn't at the top?
December 13, 2013 at 3:06 pm #78886nutsandboltsMemberThat function should have worked - I've never seen it fail to work until now. Did you copy it from here on the forum page? If you copied it from the email notification, there are likely some characters that didn't translate over well.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 13, 2013 at 3:33 pm #78890mikemuellerParticipantYup! copied it directly from the forum page.
December 14, 2013 at 1:22 pm #79097nutsandboltsMemberHmm, that's strange. Can you paste in your entire functions.php?
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 17, 2013 at 3:24 pm #79819mikemuellerParticipantHere you go. Sorry for the delay...
<?php
//* Start the engine
include_once( get_template_directory() . '/lib/init.php' );//* Set Localization (do not remove)
load_child_theme_textdomain( 'agency', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'agency' ) );//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', __( 'Agency Pro Theme', 'agency' ) );
define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/agency/' );
define( 'CHILD_THEME_VERSION', '3.0.0' );//* Add HTML5 markup structure
add_theme_support( 'html5' );//* Add viewport meta tag for mobile browsers
add_theme_support( 'genesis-responsive-viewport' );//* Enqueue EB Garamond and Spinnaker Google fonts
add_action( 'wp_enqueue_scripts', 'agency_google_fonts' );
function agency_google_fonts() {wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=EB+Garamond|Spinnaker', array(), CHILD_THEME_VERSION );
}
//* Enqueue Backstretch script and prepare images for loading
add_action( 'wp_enqueue_scripts', 'agency_enqueue_backstretch_scripts' );
function agency_enqueue_backstretch_scripts() {//* Load scripts only if custom background is being used
if ( ! get_background_image() )
return;wp_enqueue_script( 'agency-pro-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'agency-pro-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'agency-pro-backstretch' ), '1.0.0' );wp_localize_script( 'agency-pro-backstretch-set', 'BackStretchImg', array( 'src' => get_background_image() ) );
}
//* Add new image sizes
add_image_size( 'home-bottom', 380, 150, TRUE );
add_image_size( 'home-middle', 380, 380, TRUE );//* Add support for custom background
add_theme_support( 'custom-background', array( 'wp-head-callback' => 'agency_background_callback' ) );//* Add custom background callback for background color
function agency_background_callback() {if ( ! get_background_color() )
return;printf( '<style>body { background-color: #%s; }</style>' . "\n", get_background_color() );
}
//* Add support for custom header
add_theme_support( 'custom-header', array(
'header_image' => '',
'header-selector' => '.site-title a',
'header-text' => false,
'height' => 145,
'width' => 300,
) );//* Add support for additional color style options
add_theme_support( 'genesis-style-selector', array(
'agency-pro-blue' => __( 'Agency Pro Blue', 'agency' ),
'agency-pro-green' => __( 'Agency Pro Green', 'agency' ),
'agency-pro-orange' => __( 'Agency Pro Orange', 'agency' ),
'agency-pro-red' => __( 'Agency Pro Red', 'agency' ),
) );//* Add support for 3-column footer widgets
add_theme_support( 'genesis-footer-widgets', 3 );//* Reposition the header
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', 10 );
add_action( 'genesis_before', 'genesis_header_markup_close', 15 );//* Remove the site description
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );//* Register widget areas
genesis_register_sidebar( array(
'id' => 'home-top',
'name' => __( 'Home Top', 'agency' ),
'description' => __( 'This is the top section of the homepage.', 'agency' ),
) );
genesis_register_sidebar( array(
'id' => 'home-middle',
'name' => __( 'Home Middle', 'agency' ),
'description' => __( 'This is the middle section of the homepage.', 'agency' ),
) );
genesis_register_sidebar( array(
'id' => 'home-bottom',
'name' => __( 'Home Bottom', 'agency' ),
'description' => __( 'This is the bottom section of the homepage.', 'agency' ),
) );//* Reposition the secondary navigation menu
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
add_action( 'genesis_before_header', 'genesis_do_subnav' );December 17, 2013 at 11:12 pm #79866nutsandboltsMemberOkay, it will work if you go into functions.php and remove this:
//* Reposition the header 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', 10 ); add_action( 'genesis_before', 'genesis_header_markup_close', 15 );
However, you may need to adjust or remove the .site-container padding because it leaves a gap at the top. Let me know if that works.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 18, 2013 at 11:39 am #79977mikemuellerParticipantThanks Andrea - that worked!
And yes I adjusted the site container and reduced the menu bar height.
Thank you sooooo much for your help!
🙂
MM -
AuthorPosts
- The topic ‘Agency Pro static header and menu bar’ is closed to new replies.