I am currently working on a project using the ListingHive theme along with the HivePress plugin and have encountered a challenge that I require assistance with. I am attempting to customize the rendering of the listing_attributes_secondary block within the listing_view_page template. Specifically, my goal is to render these attributes in a table format, rather than the default layout provided by HivePress.
To achieve this, I have tried implementing a custom render callback function in my child theme’s functions.php file using the hivepress/v1/templates/listing_view_page/blocks filter. However, it appears that the render callback for the listing_attributes_secondary block is not being executed, as indicated by the absence of expected log messages in the debug.log file. From my understanding, you can only change the attributes present in the block but not add to it, so I cant achieve my goal using hooks.
Then I tried overriding the templates. I copied class-listing-view-page.php file and placed it under listinghive-child/hivepress/includes/templates. However, my changes are not applied to the page and HivePress still uses template from parent theme. What am I doing wrong?
Can you explain more specifically what should I override in order to change the html structure of the block? The existing parameters of the block do not allow that.
Okay, I figured the solution you suggested out and it worked eventually, thanks. I have put my PHP template file inside /htdocs/wp-content/plugins/hivepress/templates and specified the path.
The question is, wouldn’t it be lost once plugin updates?
We do not recommend adding these changes this way, as they will be overwritten as soon as there is an update on our side, it is better to use a child theme for this purpose, please check this doc How to override template parts - HivePress Help Center