Swap Site Title with Nav

Community Forums Forums Design Tips and Tricks Swap Site Title with Nav

This topic is: resolved

This topic contains 14 replies, has 2 voices, and was last updated by  chalfant 11 months, 1 week ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #79576

    chalfant
    Participant
    Post count: 132

    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.
    Thanks in advance.

    http://thevaperstable.com/
    #79607

    nutsandbolts
    Keymaster
    Post count: 3187

    Paste 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, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #79625

    chalfant
    Participant
    Post count: 132

    Thanks, Andrea. Much appreciated

    #79626

    chalfant
    Participant
    Post count: 132

    Oops……….
    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.

    #79628

    nutsandbolts
    Keymaster
    Post count: 3187

    Can 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, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #79629

    chalfant
    Participant
    Post count: 132

    Yes, doing that now……….. Give me a few minutes.
    Thanks so, so much!

    #79631

    chalfant
    Participant
    Post count: 132

    OK, done.
    I noticed however that the copied file is slightly smaller?

    But now I’m scared to touch anything!

    • This reply was modified 11 months, 1 week ago by  chalfant.
    • This reply was modified 11 months, 1 week ago by  chalfant.
    #79639

    nutsandbolts
    Keymaster
    Post count: 3187

    That’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, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #79640

    chalfant
    Participant
    Post count: 132

    <?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’ ),
    ) );

    #79645

    nutsandbolts
    Keymaster
    Post count: 3187

    Okay. 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, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #79648

    chalfant
    Participant
    Post count: 132

    Okay. 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
    Charles

    #79650

    nutsandbolts
    Keymaster
    Post count: 3187

    I 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, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #79722

    chalfant
    Participant
    Post count: 132

    Thanks, Andrea.
    Sure appreciate this.

    I’m in the office all day so whenever…………….

    #79874

    nutsandbolts
    Keymaster
    Post count: 3187

    If 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, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #79920

    chalfant
    Participant
    Post count: 132

    OK, I appreciate everything you’ve done, Andrea.
    I’m going to play around with this and report back later.

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.