Guest User

Untitled

a guest
Jan 23rd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. add_action( 'init', 'add_my_custom_header' );
  2. function add_my_custom_header() {
  3. remove_action( 'onepress_site_start', 'onepress_site_header' );
  4. add_action( 'onepress_site_start', 'custom_onepress_site_header' );
  5. }
  6.  
  7. function custom_onepress_site_header() {
  8. $header_width = get_theme_mod( 'onepress_header_width', 'contained' );
  9. $is_disable_sticky = sanitize_text_field( get_theme_mod( 'onepress_sticky_header_disable' ) );
  10. $classes = array(
  11. 'site-header',
  12. 'header-' . $header_width,
  13. );
  14.  
  15. if ( $is_disable_sticky != 1 ) {
  16. $classes[] = 'is-sticky no-scroll';
  17. } else {
  18. $classes[] = 'no-sticky no-scroll';
  19. }
  20.  
  21. $transparent = 'no-t';
  22. if ( onepress_is_transparent_header() ) {
  23. $transparent = 'is-t';
  24. }
  25. $classes[] = $transparent;
  26.  
  27. $pos = sanitize_text_field( get_theme_mod( 'onepress_header_position', 'top' ) );
  28. if ( $pos == 'below_hero' ) {
  29. $classes[] = 'h-below-hero';
  30. } else {
  31. $classes[] = 'h-on-top';
  32. }
  33.  
  34. ?>
  35. <header id="masthead" class="<?php echo esc_attr( join( ' ', $classes ) ); ?>" role="banner">
  36. <div class="container">
  37. <div class="site-branding">
  38. <?php
  39. onepress_site_logo();
  40. ?>
  41. </div>
  42. <div class="header-right-wrapper">
  43.  
  44. <!-- Your Phone number here -->
  45. <a href="tel:9135381556" style="float:right"><?php _e( 'Call Us', 'onepress' ); ?><span></span></a>
  46. <!-- End Phone number -->
  47.  
  48. <a href="#0" id="nav-toggle"><?php _e( 'Menu', 'onepress' ); ?><span></span></a>
  49. <nav id="site-navigation" class="main-navigation" role="navigation">
  50. <ul class="onepress-menu">
  51. <?php wp_nav_menu(
  52. array(
  53. 'theme_location' => 'primary',
  54. 'container' => '',
  55. 'items_wrap' => '%3$s',
  56. )
  57. ); ?>
  58. </ul>
  59. </nav>
  60. <!-- #site-navigation -->
  61. </div>
  62. </div>
  63. </header><!-- #masthead -->
  64. <?php
  65. }
Add Comment
Please, Sign In to add comment