srikat

Untitled

Sep 5th, 2016
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2.  
  3. /* Template Name: Custom Full Width Page Template */
  4.  
  5. add_filter( 'body_class', 'sk_body_class' );
  6. /**
  7. * Adds a css class to the body element
  8. *
  9. * @param array $classes the current body classes
  10. * @return array $classes modified classes
  11. */
  12. function sk_body_class( $classes ) {
  13. $classes[] = 'full-width';
  14. return $classes;
  15. }
  16.  
  17. add_filter( 'genesis_attr_site-inner', 'sk_attributes_site_inner' );
  18. /**
  19. * Add attributes for site-inner element.
  20. *
  21. * @since 2.0.0
  22. *
  23. * @param array $attributes Existing attributes.
  24. *
  25. * @return array Amended attributes.
  26. */
  27. function sk_attributes_site_inner( $attributes ) {
  28.  
  29. $attributes['role'] = 'main';
  30. $attributes['itemprop'] = 'mainContentOfPage';
  31.  
  32. return $attributes;
  33.  
  34. }
  35.  
  36. // Remove div.site-inner's div.wrap
  37. add_filter( 'genesis_structural_wrap-site-inner', '__return_empty_string' );
  38.  
  39. // Display header
  40. get_header();
  41.  
  42. // Content
  43. the_post(); // sets the 'in the loop' property to true.
  44. the_content();
  45.  
  46. // Display Footer
  47. get_footer();
Advertisement
Add Comment
Please, Sign In to add comment