Home Support Extensions Tags Tags

Tags

  • Author
    Posts
  • DivineK

    Hi,
    Is it possible to have tags under a specific categories?

    ihor developer

    Hi,
    Sorry for the late reply. The easiest way to do this at the moment is via this PHP snippet:

    add_filter(
    	'hivepress/v1/models/listing/fields',
    	function( $fields, $listing ) {
    		if ( ! array_intersect( [ 1, 2, 3 ], (array) $listing->get_categories__id() ) ) {
    			$fields['tags']['display_type'] = 'hidden';
    		}
    
    		return $fields;
    	},
    	1000,
    	2
    );

    Replace “1, 2, 3” with category IDs. You can also consider leaving the Tags field for all categories since this field is optional by default.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.