Using Pods Templates for Search

A simple way to include Pods Templates in Search Results, using the name of the Pods Template.

This particular implementation requires naming your Pods Templates for the ‘archive’ to a style of {post_type}-archive.

function force_pods_the_content_archive( $content ) {
	if (is_search() && is_pod()) {
		return pods(get_post_type(), get_the_id())->template(get_post_type() . '-archive');
	}
	return $content;
}
add_filter( 'the_content', 'force_pods_the_content_archive');

Submitted by @dupontb from WordPress.org Forum Post.

Questions