Guest User

Untitled

a guest
Jun 20th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. function special_divi_header(){?>
  2. <ul id="new-top-menu">
  3. <?php echo wp_nav_menu( array( 'theme_location' => 'secondary-menu' ) ); ?>
  4. </ul>
  5. <script>
  6. jQuery(document).ready(function ($) {
  7.  
  8. $("<ul id='new-menu'></ul>").insertAfter("#et-top-navigation");
  9. $("#mobile_menu_slide .outside").clone().appendTo("#new-menu");
  10. $("#top-menu").insertBefore("#main-header .container");
  11.  
  12. var $window = $(window),
  13. $page = $('body');
  14.  
  15. function resize() {
  16. if ($window.width() < 980) {
  17. return $page.addClass('hide-new-menu');
  18. }
  19.  
  20. $page.removeClass('hide-new-menu');
  21. }
  22.  
  23. $window
  24. .resize(resize)
  25. .trigger('resize');
  26. });
  27. </script>
  28. <style>
  29. #new-menu li {
  30. display: inline-block;
  31. margin-left: 20px;
  32. font-weight: 600;
  33. }
  34.  
  35. #new-menu {
  36. display: inline;
  37. float: right;
  38. padding-top: 26px;
  39. margin-right: 20px;
  40. }
  41.  
  42. .logo_container {
  43. z-index: -1;
  44. }
  45.  
  46. .et-fixed-header #new-menu {
  47. padding-top: 26px; /* adjust if header is different size after scroll */
  48. }
  49.  
  50. #new-menu li a {
  51. color: #303030;
  52. }
  53.  
  54. body #mobile_menu_slide .outside {
  55. display: none;
  56. }
  57.  
  58. body.hide-new-menu #mobile_menu_slide .outside {
  59. display: block ;
  60. }
  61.  
  62. body.hide-new-menu #new-menu {
  63. display: none;
  64. }
  65.  
  66. #top-header {
  67. display: block !important;
  68. }
  69.  
  70. body:not(.hide-new-menu) #new-top-menu {
  71. display: block;
  72. position: absolute;
  73. top: -36px;
  74. left: 0;
  75. width: 100%;
  76. height: 40px;
  77. background: #303030;
  78. padding: 6px 40px;
  79. }
  80.  
  81. body:not(.hide-new-menu) #new-top-menu li {
  82. float: right;
  83. margin-left: 20px;
  84. }
  85.  
  86. body:not(.hide-new-menu) #new-top-menu li a {
  87. color: #fff;
  88. }
  89.  
  90. body:not(.hide-new-menu) #main-header {
  91. margin-top: 36px;
  92. }
  93.  
  94. .hide-new-menu #new-top-menu {
  95. display: none !important;
  96. }
  97. </style>
  98. <?php
  99. }
  100. add_action( 'et_header_top', 'special_divi_header', 99 );
Add Comment
Please, Sign In to add comment