Açıklama Yok

header-actions.php 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * The file for header all actions
  4. *
  5. *
  6. * @package XShop
  7. */
  8. function xshop_header_top_output(){
  9. $xshop_header_address1 = get_theme_mod( 'xshop_header_address1' );
  10. $xshop_header_address2 = get_theme_mod( 'xshop_header_address2' );
  11. ?>
  12. <header id="masthead" class="site-header <?php if( has_header_image() ): ?>has-head-img<?php endif; ?>">
  13. <?php if( has_header_image() ): ?>
  14. <?php if( has_header_image() ): ?>
  15. <div class="header-img">
  16. <?php the_header_image_tag(); ?>
  17. </div>
  18. <?php endif; ?>
  19. <?php endif; ?>
  20. <div class="container">
  21. <div class="head-logo-sec">
  22. <?php
  23. if(has_custom_logo() || display_header_text() == true || (display_header_text() == true && is_customize_preview()) ): ?>
  24. <div class="site-branding brand-logo">
  25. <?php
  26. if(has_custom_logo()):
  27. the_custom_logo();
  28. endif;
  29. ?>
  30. </div>
  31. <div class="site-branding brand-text">
  32. <?php if (display_header_text() == true || (display_header_text() == true && is_customize_preview()) ): ?>
  33. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  34. <?php
  35. $xshop_description = get_bloginfo( 'description', 'display' );
  36. if ( $xshop_description || is_customize_preview() ) :
  37. ?>
  38. <p class="site-description"><?php echo $xshop_description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
  39. <?php endif; ?>
  40. <?php endif; ?>
  41. </div><!-- .site-branding -->
  42. <?php if( $xshop_header_address1 || $xshop_header_address2): ?>
  43. <div class="head-info">
  44. <?php if($xshop_header_address1): ?>
  45. <div class="mobile"><?php echo esc_html($xshop_header_address1) ?></div>
  46. <?php endif; ?>
  47. <?php if($xshop_header_address2): ?>
  48. <div class="xmail"><?php echo esc_html($xshop_header_address2) ?></div>
  49. <?php endif; ?>
  50. </div>
  51. <?php endif; ?>
  52. </div>
  53. </div>
  54. <?php endif; ?>
  55. <div class="menu-bar text-center">
  56. <div class="container">
  57. <div class="xshop-container menu-inner">
  58. <nav id="site-navigation" class="main-navigation">
  59. <?php
  60. wp_nav_menu( array(
  61. 'theme_location' => 'main-menu',
  62. 'menu_id' => 'xshop-menu',
  63. 'menu_class' => 'xshop-menu',
  64. ) );
  65. ?>
  66. </nav><!-- #site-navigation -->
  67. </div>
  68. </div>
  69. </div>
  70. </header><!-- #masthead -->
  71. <?php
  72. }
  73. add_action('xshop_header_top','xshop_header_top_output');