Advertisement
srikat

Untitled

Dec 19th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. add_filter( 'template_include', 'business_blog_template', 99 );
  2. /**
  3. * Custom blog template path.
  4. *
  5. * The following function adds a custom template path for the home
  6. * and archive template. This short circuits the WordPress template
  7. * hierarchy and allows us to reuse the masonry template.
  8. *
  9. * @since 1.0.0
  10. *
  11. * @param string $template The template path.
  12. * @return string
  13. */
  14. function business_blog_template( $template ) {
  15.  
  16. if ( is_search() || is_archive() && ! is_post_type_archive() && ! is_tax() ) {
  17. return get_stylesheet_directory() . '/templates/page-masonry.php';
  18. }
  19.  
  20. return $template;
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement