Center Logo and Navigation in Header

This is a PRIVATE forum for verified users only, to view all replies/answers, you must be logged in!

Status: not resolved
  • This topic has 0 replies, 1 voice, and was last updated 4 y by  lelagrl.
Viewing 0 reply threads
  • Author
    Posts
    • #14244

      lelagrl
      Member

      Trying to center my logo over the main navigation using the instructions from this thread, but no luck.

      https://wpthms.com/support/topic/center-navigation-bar/

      I am using a child theme and placed the following code in my custom-funcitons.php file, but it’s not working. I am using the most recent version of Sparkle (2.0.7) so I wonder if the following code no longer works with the current theme version considering the thread I am referencing is almost a year old? Please advise, thanks!

      remove_action( 'yt_inside_header','yt_site_branding', 15);
      add_action( 'yt_inside_header','yt_site_branding10282014', 14); 
      
      function yt_site_branding10282014(){
      	
      	/**
      	 * Retrieve Options data
      	 */
      	$heading = is_home() ? 'h1' : 'h3';
      	
      
      	//Branding
      	$branding = '<div class="col-md-12 site-branding pull-left">
      		<'.$heading.' class="site-logo plain-text-logo"><a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( yt_get_options('plain_logo_text') ) . '" rel="home">' . yt_get_options('plain_logo_text') . '</a></'.$heading.'>
      	</div>';
      	
      	if( !yt_get_options('plain_logo') && yt_get_options('logo') ){
      		$branding = '<div class="col-md-12 site-branding pull-left">
      			<'.$heading.' class="site-logo image-logo"><a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( yt_get_options('plain_logo_text') ) . '" rel="home"><img alt="' . esc_attr( yt_get_options('plain_logo_text') ) . '" src="'. esc_url( yt_get_options('logo') ) .'">' . '</a></'.$heading.'>
      		</div>';
      	}
      	
      	$branding = apply_filters( 'yt_site_branding', $branding );
      
      	echo $branding;
      	
      }
      
      remove_action( 'yt_inside_header','yt_site_primary_nav', 15 );
      
      add_action( 'yt_inside_header','yt_site_primary_nav10282014', 20);
      function yt_site_primary_nav10282014(){
      	$primary_menu = '';
      	//Navnav
      	if ( has_nav_menu( 'primary' ) ) {
      		$primary_menu = wp_nav_menu(
      			apply_filters( 'yt_site_primary_navigation_args', array( 
      				'theme_location' => 'primary' , 
      				'echo' => false, 
      				'container_class' => 'site-navigation-menu-container',
      				'menu_class'      => 'menu',
      				'depth' => 5,
      				'walker' => new YT_Walker_Nav_Mega_Menu_By_Category()
      			))
      		);
      	}else{
      		$primary_menu = '<ul class="menu"><li>' . sprintf( __('Create a Menu in <a href="%s">Menus</a> and assign it as Primary Menu in <a href="%s">Theme Location</a>', 'wpthms'), admin_url('nav-menus.php'), admin_url('nav-menus.php?action=locations') ) . '</li></ul>';
      	}
      	
      	$site_navigaton = '<nav id="site-navigation" class="col-sm-12 col-md-12 main-navigation" role="navigation">
      		<div class="sr-only skip-link"><a href="#content" title="' . esc_attr( 'Skip to content', 'wpthms' ) . '">' . __( 'Skip to content', 'wpthms' ) . '</a></div>
      
      		' . $primary_menu . '
      	</nav><!-- #site-navigation -->';
      	
      	//Allow editing site
      	$site_navigaton = yt_apply_atomic( 'site_primary_menu', $site_navigaton );
      	
      	echo $site_navigaton;
      }
Viewing 0 reply threads
  • You must be logged in to reply to this topic.

This is a PRIVATE forum for verified users only, to view all replies/answers, you must be logged in!

© Copyright 2020 by wpthms.com. All Rights Reserved.