Advertisement
catchmahesh

FullFrame Pro: Move Site title above menu + social icons

Aug 2nd, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.99 KB | None | 0 0
  1. function fullframe_primary_menu() {
  2.     $options  = fullframe_get_theme_options();
  3.     ?>
  4.     <nav class="nav-primary" role="navigation">
  5.         <div class="wrapper">
  6.             <div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'full-frame-pro' ); ?>"><?php esc_html_e( 'Skip to content', 'full-frame-pro' ); ?></a></div>
  7.             <?php
  8.                 if ( '1' != $options['responsive_select'] ) {
  9.                     // Header Left Mobile Menu Anchor
  10.  
  11.                     $flag = 1;
  12.                     if ( '1' != $options['primary_menu_disable'] ) {
  13.                         if ( has_nav_menu( 'primary' ) ) {
  14.                             $classes = "mobile-menu-anchor primary-menu";
  15.                         }
  16.                         else {
  17.                             $classes = "mobile-menu-anchor page-menu";
  18.                         }
  19.                     }
  20.                     elseif ( has_nav_menu( 'secondary' ) ) {
  21.                         $classes = "mobile-menu-anchor secondary-menu";
  22.                     }
  23.                     else {
  24.                         $classes = "mobile-menu-anchor displaynone";
  25.  
  26.                         $flag = 0;
  27.                     }
  28.  
  29.                     if ( $flag ) {
  30.                         ?>
  31.  
  32.                         <div id="mobile-header-left-menu" class="<?php echo $classes; ?>">
  33.                             <a href="#mobile-header-left-nav" id="header-left-menu" class="genericon genericon-menu">
  34.                                 <span class="mobile-menu-text"><?php esc_html_e( 'Menu', 'full-frame-pro' );?></span>
  35.                             </a>
  36.                         </div><!-- #mobile-header-menu -->
  37.  
  38.                         <?php
  39.                     }
  40.                 }
  41.  
  42.                 $logo_alt = ( '' != $options['logo_alt_text'] ) ? $options['logo_alt_text'] : get_bloginfo( 'name', 'display' );
  43.  
  44.                 if ( isset( $options[ 'logo_icon' ] ) &&  $options[ 'logo_icon' ] != '' &&  !empty( $options[ 'logo_icon' ] ) ){
  45.                      echo '<div id="logo-icon"><a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" rel="home">
  46.                        <img src="' . esc_url( $options['logo_icon'] ) . '" alt="' . esc_attr( $logo_alt ). '">
  47.                    </a></div>';
  48.                 }
  49.  
  50.                 if ( '1' != $options['primary_menu_disable'] ) {
  51.                     echo '<h1 class="assistive-text">' . esc_html__( 'Primary Menu', 'full-frame-pro' ) . '</h1>';
  52.  
  53.                     if ( has_nav_menu( 'primary' ) ) {
  54.                         $fullframe_primary_menu_args = array(
  55.                             'theme_location'    => 'primary',
  56.                             'menu_class'        => 'menu fullframe-nav-menu',
  57.                             'container'         => false
  58.                         );
  59.                         wp_nav_menu( $fullframe_primary_menu_args );
  60.                     }
  61.                     else {
  62.                         wp_page_menu( array( 'menu_class'  => 'menu fullframe-nav-menu' ) );
  63.                     }
  64.                 }
  65.  
  66.                 if( '1' != $options['header_toggle_disable'] ) {
  67.                     ?>
  68.                     <div id="header-toggle" class="genericon">
  69.                         <a class="screen-reader-text" href="#header-container"><?php esc_html_e( 'Header Toggle', 'full-frame-pro' ); ?></a>
  70.                     </div>
  71.                     <?php
  72.                 }
  73.                 elseif ( '1' != $options['primary_menu_disable'] && has_nav_menu( 'secondary' ) ) {
  74.                     $classes = "mobile-menu-anchor secondary-menu";
  75.                     // Header Right Mobile Menu Anchor
  76.                     ?>
  77.                     <div id="mobile-header-right-menu" class="<?php echo $classes; ?>">
  78.                         <a href="#mobile-header-right-nav" id="header-right-menu" class="genericon genericon-menu">
  79.                             <span class="mobile-menu-text"><?php esc_html_e( 'Menu', 'full-frame-pro' );?></span>
  80.                         </a>
  81.                     </div><!-- #mobile-header-menu -->
  82.                     <?php
  83.                 }
  84.                 ?>
  85.                 <?php
  86.                     //Social Icons inline with primary menu
  87.                     if ( '' != ( $fullframe_social_icons = fullframe_get_social_icons() ) ) { ?>
  88.                     <div id="social_icons_menu" class="widget_fullframe_social_icons">
  89.                         <?php echo $fullframe_social_icons; ?>
  90.                     </div>
  91.                 <?php } ?>
  92.         </div><!-- .wrapper -->
  93.     </nav><!-- .nav-primary -->
  94.         <?php
  95. }
  96.  
  97. function fullframe_menu_under_site_branding() {
  98.     remove_action( 'fullframe_header', 'fullframe_fixed_header_start', 20 );
  99.     remove_action( 'fullframe_header', 'fullframe_fixed_header_end', 80 );
  100.     remove_action( 'fullframe_header', 'fullframe_primary_menu', 30 );
  101.  
  102.  
  103.     add_action( 'fullframe_header', 'fullframe_fixed_header_start', 60 );
  104.     add_action( 'fullframe_header', 'fullframe_fixed_header_end', 80 );
  105.     add_action( 'fullframe_header', 'fullframe_primary_menu', 70 );
  106. }
  107. add_action('init', 'fullframe_menu_under_site_branding');
  108.  
  109. function fullframe_masthead() {
  110.     //Getting Ready to load options data
  111.     $options = fullframe_get_theme_options();
  112.  
  113.     if ( '1' == $options['logo_disable'] &&  '1' == $options['disable_header_right_sidebar'] && '1' !=display_header_text() ) {
  114.         return;
  115.     }
  116.  
  117.     if ( '1' != $options['header_toggle_disable'] ) {
  118.         add_action( 'fullframe_header', 'fullframe_header_start', 40 );
  119.         add_action( 'fullframe_header', 'fullframe_site_branding', 50 );
  120.         add_action( 'fullframe_header', 'fullframe_header_right', 60 );
  121.         add_action( 'fullframe_header', 'fullframe_header_end', 70 );
  122.     }
  123.     else {
  124.         add_action( 'fullframe_header', 'fullframe_header_start', 20 );
  125.         add_action( 'fullframe_header', 'fullframe_site_branding', 30 );
  126.         add_action( 'fullframe_header', 'fullframe_header_right', 40 );
  127.         add_action( 'fullframe_header', 'fullframe_header_end', 50 );
  128.     }
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement