srikat icon

Untitled

srikat | PRO | 12/20/17 01:03:09 AM UTC | 0 ⭐ | 536 👁️ | Never ⏰ | []
text |

610 B

|

None

|

0 👍

/

0 👎

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_search() || is_archive() && ! is_post_type_archive() && ! is_tax() ) {
		return get_stylesheet_directory() . '/templates/page-masonry.php';
	}
 	return $template;
 }

Comments