Community Forums › Forums › Archived Forums › Design Tips and Tricks › Swap Site Title with Nav
Tagged: Nav Menu and Title
- This topic has 14 replies, 2 voices, and was last updated 10 years, 4 months ago by chalfant.
-
AuthorPosts
-
December 16, 2013 at 5:18 pm #79576chalfantMember
I know it's been done but not sure how.
I'd like the title to be where my nav menu is. So, swapping them out.
Can anyone advise how to do this please?Also, cannot get the site description to display on the Agency Pro theme.
http://thevaperstable.com/
Thanks in advance.December 16, 2013 at 7:07 pm #79607nutsandboltsMemberPaste this into functions.php to swap the nav and header:
//* Reposition the primary navigation menu remove_action( 'genesis_after_header', 'genesis_do_nav' ); add_action( 'genesis_before_header', 'genesis_do_nav' );
To show the site description, remove this from functions.php:
//* Remove the site description remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 16, 2013 at 8:27 pm #79625chalfantMemberThanks, Andrea. Much appreciated
December 16, 2013 at 8:37 pm #79626chalfantMemberOops..........
I followed the directions but got this error-Parse error: syntax error, unexpected T_STRING in /home4/chalfant/public_html/wp-content/themes/agency-pro/functions.php on line 108
Sorry, Andrea. Not sure what I did wrong but I did copy as directed.
I removed the paste info but this error still remains. Obviously the site is not responding.December 16, 2013 at 8:49 pm #79628nutsandboltsMemberCan you paste in your entire functions file? You'll have to access the file via FTP or your hosting file manager to access it. No worries, though - it's very fixable!
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 16, 2013 at 8:56 pm #79629chalfantMemberYes, doing that now........... Give me a few minutes.
Thanks so, so much!December 16, 2013 at 9:00 pm #79631chalfantMemberOK, done.
I noticed however that the copied file is slightly smaller?But now I'm scared to touch anything!
December 16, 2013 at 9:17 pm #79639nutsandboltsMemberThat's okay - paste it here so I can take a look. I have the stock functions file on my computer if we need to replace it.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 16, 2013 at 9:20 pm #79640chalfantMember<?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' => str_replace( 'http:', '', 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 !important; }</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' => 60,
'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' ),
) );December 16, 2013 at 9:32 pm #79645nutsandboltsMemberOkay. Open the file in FTP or File Manager, erase all of it, and replace it with this. (Be sure to copy this from the forum page and not from your email notification as some of the characters don't display correctly in the email.) I've included the function to move the navigation and removed the function that hides the site description.
<?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' => 60, '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 ); //* Reposition the primary navigation menu remove_action( 'genesis_after_header', 'genesis_do_nav' ); add_action( 'genesis_before_header', 'genesis_do_nav' ); //* 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' ), ) );
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 16, 2013 at 9:43 pm #79648chalfantMemberOkay. I did it and the site is back up,
The title and nav did not swap but tonight this is not my main concern as I've been up since 4am. Need sleep!You are a WP Guru Andrea. Thanks so much for the time..........
Be in touch
CharlesDecember 16, 2013 at 9:47 pm #79650nutsandboltsMemberI just noticed that the header has been repositioned, so that function is the wrong one. Let me know when you've had some rest and we'll see if we can break it again tomorrow! 🙂
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 4:37 am #79722chalfantMemberThanks, Andrea.
Sure appreciate this.I'm in the office all day so whenever................
December 17, 2013 at 11:26 pm #79874nutsandboltsMemberIf you remove this from functions.php, the navigation will move like it's supposed to, but you'll need to adjust or remove the padding on .site-container in your stylesheet because it leaves a gap.
//* 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 );
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 3:14 am #79920chalfantMemberOK, I appreciate everything you've done, Andrea.
I'm going to play around with this and report back later. -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.