Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Created February 9, 2026 19:42
Show Gist options
  • Select an option

  • Save propertyhive/6fc78f5a4b48f38a7b02a6e6fe47a5c1 to your computer and use it in GitHub Desktop.

Select an option

Save propertyhive/6fc78f5a4b48f38a7b02a6e6fe47a5c1 to your computer and use it in GitHub Desktop.
add_filter( 'propertyhive_locate_template', 'intercept_ph_template', 10, 3 );
function intercept_ph_template( $template, $template_name, $template_path )
{
if ( 'loop-start.php' === basename( $template ) ) {
$template = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'ph/templates/search/loop-start.php';
}
if ( 'loop-end.php' === basename( $template ) ) {
$template = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'ph/templates/search/loop-end.php';
}
return $template;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment