add_filter( 'template_include', 'business_blog_template', 99 ); /** * Custom blog template path. * * The following function adds a custom template path for the home * and archive template. This short circuits the WordPress template * hierarchy and allows us to reuse the masonry template. * * @since 1.0.0 * * @param string $template The template path. * @return string */ function business_blog_template( $template ) { if ( is_home() || is_search() || is_archive() && ! is_post_type_archive() && ! is_tax() ) { return get_stylesheet_directory() . '/templates/page-masonry.php'; } return $template; }