Custom type "hp_template" its not visible

Hi!

The problem is that the custom record type “hp_templates” - is not showing up in the record settings.

I’m trying to connect the commenting plugin “wpdisquz” which would allow through template editing, to add a commenting system on user profile pages.

Initially ran into an issue that your custom record type does not support comments. I fixed that using this code :

function comment_support_for_my_custom_post_type() {
 add_post_type_support( 'hp_template' , 'comments' );
}
add_action( 'init', 'comment_support_for_my_custom_post_type' );

After adding this code, adding comments to the custom record type “hp_template” became possible, even the standard comments widget started showing up in the template edit.

But considering that in “template edit” comments started to be reflected as working plugins, after saving and going to the site, they are not displayed.

I decided to check what’s wrong, it turned out that you need to check the box in the settings to display the custom type of records “hp_template”, but neither in the standard settings of WP, nor in the settings of WpDisquz, your custom type of records are not displayed.

The main question is how to display your custom record type in the admin panel. I understand that it must be some php code, but given that I don’t know how this template is written, I don’t know how to do it.

I would be happy to help in providing this solution.

Hi,

This is a functional post type used for creating custom templates which override built-in HivePress templates. There are no front-end pages which display actual hp_template post type, these are used for completely different URLs (depending on which template is overridden), so just enabling comments will not work for sure.

Please describe the required functionality, there may be an easier way, do you mean adding comments to the regular user profiles or vendor profiles?

  1. Yes, Igor, you are right. I want to add the ability to connect comments to the suppliers/users page (I have “direct registration” enabled).

  2. I was able to add the comments widget both standard and from WpDisquz to the listing page(hp_listing). Maybe this will be a temporary solution for someone until the classic HivePress reviews are finalized ( I’ve seen a lot of forum requests on this topic).
    I managed to implement it with this code (you can test it and it really works):

function comment_support_for_my_custom_post_type() {
 add_post_type_support( 'hp_template' , 'comments' );
 add_post_type_support( 'hp_listing' , 'comments' );
}
add_action( 'init', 'comment_support_for_my_custom_post_type' );

But as soon as I tried to do the same for the Hp_vendor page, I didn’t get any result. The hp_vendor record type itself started showing up in the comment settings and it can be selected for commenting. But when you set the comments widget on the vendor template page, it doesn’t work, what could be the issue?

Example function for vendor:

function comment_support_for_my_custom_post_type() {
 add_post_type_support( 'hp_template' , 'comments' );
 add_post_type_support( 'hp_vendor' , 'comments' );
}
add_action( 'init', 'comment_support_for_my_custom_post_type' );


1 Screenshot (nothing displayed) is the vendor page
2 Screenshot (comments are displayed) - this is the listing page

With the same code ( only the template type is changed), completely different result.

I checked the other custom pages from your theme as well, they are also enabled for comments, but it is the comment widgets that are not showing up on them.
Except for the listing page.

I thought maybe you didn’t specify the ability to comment at the code level when creating the template record types.
That is, for the announcement page you have specified, because it is the only place in your theme to which your classic reviews fits. But the others don’t.

If I’m right, could you provide me with a snippet that would add the ability to comment on the “hp_vendor” page specifically?

If I’m wrong, I’m still waiting for an answer and would welcome any help!

Hello, it’s already the 2nd day I’m counting on your help, I believe that I have stated my request as clearly as possible.
I realize that with premium support you would have replied faster, but I bought all your plugins a long time ago and the 6 months period is over.

In the time I’ve been waiting for a response from you, I’ve even tried forcing comments on all pages using this code:

function switch_on_comments_automatically(){
    global $wpdb;
    $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET comment_status = 'open'")); 
}
switch_on_comments_automatically();

This forced comments on all pages except the vendors page.
I really don’t understand what’s wrong and would be happy to get a solution.

If you want to add comments to the vendor pages, please try this approach:

  1. Add comments to the vendor post type support via the hivepress/v1/post_types hook (you can check that it works if the Comments section appears when you edit a vendor on the back-end).

  2. Insert a new template part to the vendors page via the hivepress/v1/templates/vendor_view_page hook https://www.youtube.com/watch?v=LkojYp-8uwY You can try to re-use the basic comments.php theme file this way, or at least copy its contents; this will ensure that comments and the comment form are styled well.

Please note that template customizations will work only if the vendor page is not overridden by a custom template in HivePress/Templates in WordPress dashboard (custom template have a higher priority). Or maybe there’s a core Comments block in the WordPress editor which can be used instead of comments.php if you need a custom template in any case.

This should be enough, adding the comments support for the post type + displaying the comments along with the comments form on the post type page.

Hope this helps