How to override template parts

If you need to override the default template parts, please use the child theme. You can create a child theme by following this instruction.

For example, if you need to override the listing block titles, please follow these steps:

  1. Navigate to the HivePress plugin directory, and find the template parts you want to override. You can find the listing block titles in the hivepress/templates/listing/view/block/listing-title.php path;
  2. Create a directory with hivepress name in the child theme directory. Then in hivepress directory, you have to create the following path listing/view/block ;
  3. Copy the template part (listing-title.php file) to the child theme directory block ;
  4. Replace the previous content with the one you need, as shown in the screencast below.

Important notes:

The template part in the child theme must have the same name as the one that you want to override. Also, you don't need to change these parts of the content in the template:

  • // Exit if accessed directly.
  • defined( 'ABSPATH' ) || exit;

Now, the copy template has higher priority than the template part located in the plugin directory, and you can easily customize it in the way you like.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.