echo ( new \HivePress\Blocks\Part(
'path' => 'listing-category/view/listing-category-item-count',
'context' => [ 'listing_category' => $listing_category ],
<?php echo esc_html( $listing_category->get_name() ); ?>
This code gives the name of the category/subcategory, but suppose I want to get the name of the parent category, then what should be done???
Also, I am new to PHP, I don’t get what we are actually doing here, can you pls explain or give me some link where I can understand the above coding. This path and context above, I don’t get it, what is this.