How to show content if the current category is anchored in Magento 2

If you want to show any content on the category page if current category is anchored, Follow these steps:

1. First of all get the current category by Object manager with apply this code:
<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');

?>
2. Then create a variable to get anchor with apply this code:
$categoryanc = $category->getIsAnchor();
3. Then add condition to show content if category is anchored, apply this code:
if ($categoryanc == 1) {
     echo "This is a anchor category.";
}
Now you can see this output if the current category is anchored:
This is a anchor category.
How to show content if the current category is anchored in Magento 2expoundsofttechsolution Install node js on Go Daddy Shared hosting.