Free Directory, Listing & Classifieds WordPress Plugin Support General HivePress Putting comments in the product’s page

Putting comments in the product’s page

  • Author
    Posts
  • shenei

    Is it possible to put a comment section in the anouncements pages? Or to change the hivepress review section to the wordpress comments section?

    ihordeveloper

    You can try using this code snippet:

    add_filter(
    	'hivepress/v1/post_types',
    	function( $post_types ) {
    		$post_types['listing']['supports'][] = 'comments';
    
    		return $post_types;
    	}
    );
    
    add_filter(
    	'hivepress/v1/templates/listing_view_page',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'page_content' => [
    						'blocks' => [
    							'listing_comments' => [
    								'type'     => 'callback',
    								'callback' => 'comments_template',
    								'_order'   => 100,
    							],
    						],
    					],
    				],
    			]
    		);
    	}
    );
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Subscribe

Sign In

Don't have an account? Register

Forgot password?

Register

Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.