How to override the single listing page template with custom HTML

i have created single-hp_listing.php and added my custom design code there and i have added this code in function.php but, i am redirecting to the default single page.

add_filter( 'template_include', function( $template ) {
    if ( is_singular( 'hp_listing' ) ) {
        $custom_template = locate_template( 'single-hp_listing.php' );
        if ( ! empty( $custom_template ) ) {
            return $custom_template;
        }
    }
    return $template;
}, 99999 );

Hi,

Unfortunately there’s no way to override the whole template with plain HTML this way, HivePress framework renders templates as arrays of blocks - this allows keeping backward compatibility and integrations (e.g. this way extensions can integrate their HTML parts into the template). There are 2 ways to customize templates:

  1. Override them in HivePress/Templates, this way you can re-build the whole listing page layout without coding How to customize templates - HivePress Help Center
  2. If you want to override the listing template with code, you can do this via the hivepress/v1/templates/listing_view_page filter hook. You can find sample code snippets on the forum Search results for 'hivepress/v1/templates/listing_view_page' - HivePress Community Also, here’s a screencast that may be useful https://www.youtube.com/watch?v=LkojYp-8uwY

Hope this helps

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.