Advertisement
Guest User

header-logo.php

a guest
Oct 16th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.58 KB | None | 0 0
  1. <?php
  2.     global $nm_theme_options;
  3.            
  4.     // Logo URL
  5.     if ( isset( $nm_theme_options['logo'] ) && strlen( $nm_theme_options['logo']['url'] ) > 0 ) {
  6.         $logo_href = ( is_ssl() ) ? str_replace( 'http://', 'https://', $nm_theme_options['logo']['url'] ) : $nm_theme_options['logo']['url'];
  7.     } else {
  8.         $logo_href = NM_THEME_URI . '/assets/img/logo@2x.png';
  9.     }
  10.    
  11.     // Alternative logo
  12.     $has_alt_logo = false;    
  13.     if ( $nm_theme_options['alt_logo'] ) {
  14.         $has_alt_logo = true;
  15.        
  16.         // Logo URL
  17.         if ( isset( $nm_theme_options['alt_logo_image'] ) && strlen( $nm_theme_options['alt_logo_image']['url'] ) > 0 ) {
  18.             $alt_logo_href = ( is_ssl() ) ? str_replace( 'http://', 'https://', $nm_theme_options['alt_logo_image']['url'] ) : $nm_theme_options['alt_logo_image']['url'];
  19.         } else {
  20.             $alt_logo_href = NM_THEME_URI . '/assets/img/logo-light@2x.png';
  21.         }
  22.     }
  23. ?>
  24. <div class="nm-header-logo">
  25.     <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
  26.         <img src="<?php echo esc_url( $logo_href ); ?>" class="nm-logo" alt="<?php bloginfo( 'name' ); ?>">
  27.         <?php if ( $has_alt_logo ) : ?>
  28.         <img src="<?php echo esc_url( $alt_logo_href ); ?>" class="nm-alt-logo" alt="<?php bloginfo( 'name' ); ?>">
  29.         <?php endif; ?>
  30.     </a>
  31.  
  32.     <style type="text/css">
  33.         #flags_language_selector img{
  34.             margin:1px;
  35.             border:1px solid #333;
  36.         }
  37.         #flags_language_selector, .desktop {
  38.             /*margin-left: 930px;
  39.             padding-top: 12px;*/
  40.             float: right;
  41.         }
  42.         .country-flag {
  43.             height: 18px !important;
  44.         }
  45.         #flags_language_selector a{
  46.             cursor: pointer;
  47.         }
  48.         #flags_language_selector img {
  49.             opacity: 0.5;
  50.         }
  51.         #flags_language_selector a img{
  52.             opacity: 1;
  53.         }
  54.         .mobile { display: none; }
  55.         @media only screen and (max-width: 768px) {
  56.             #flags_language_selector {
  57.                 float: initial;
  58.             }
  59.             #flags_language_selector a{
  60.                 display: inline;
  61.             }
  62.             .country-flag {
  63.                 height: initial !important;
  64.             }
  65.             #flags_language_selector img {
  66.                 vertical-align: middle;
  67.             }
  68.             .mobile { display: block; }
  69.             .desktop { display: none; }
  70.         }
  71.     </style>
  72.     <div class="desktop">
  73.         <div id="flags_language_selector"><?php language_selector_flags_opposite(); ?></div >
  74.     </div>  
  75.  
  76. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement