2 added 42 characters in body
source | link
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
      $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');
$category->getId();
$category->getAllChildern();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
      $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');
$category->getId();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
      $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');
$category->getId();
$category->getAllChildern();
1
source | link

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
      $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');
$category->getId();