Advertisement
srikat

Untitled

Jan 28th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. add_filter( 'genesis_markup_site-header_open', 'insert_html_before_site_header_markup', 10, 2 );
  2. /**
  3. * Appends HTML to the opening markup for .site-header.
  4. *
  5. * @param string $close_html HTML tag being processed by the API.
  6. * @param array $args Array with markup arguments.
  7. *
  8. * @return string
  9. */
  10. function insert_html_before_site_header_markup( $open_html, $args ) {
  11. if ( $open_html ) {
  12. $additional_html = '<div class="sticky-header">';
  13.  
  14. $open_html = $additional_html . $open_html;
  15. }
  16.  
  17. return $open_html;
  18. }
  19.  
  20. add_filter( 'genesis_markup_site-container_open', 'insert_html_before_site_container_markup', 10, 2 );
  21. /**
  22. * Appends HTML to the opening markup for .site-container.
  23. *
  24. * @param string $close_html HTML tag being processed by the API.
  25. * @param array $args Array with markup arguments.
  26. *
  27. * @return string
  28. */
  29. function insert_html_before_site_container_markup( $open_html, $args ) {
  30. if ( $open_html ) {
  31. $additional_html = '</div>';
  32.  
  33. $open_html = $additional_html . $open_html;
  34. }
  35.  
  36. return $open_html;
  37. }
  38.  
  39. remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
  40. remove_action( 'genesis_header', 'genesis_do_header' );
  41. remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
  42. remove_action( 'genesis_after_header', 'genesis_do_nav' );
  43.  
  44. add_action( 'genesis_before', 'genesis_header_markup_open' );
  45. add_action( 'genesis_before', 'genesis_do_header' );
  46. add_action( 'genesis_before', 'genesis_header_markup_close' );
  47. add_action( 'genesis_before', 'genesis_do_nav' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement