Get the ID of child categories of a parent used inside the loop

Description

PHP Source Code

                        
                          <!--Get IDs start-->	
				<?php
				foreach((get_the_category()) as $childcat) {
				if (cat_is_ancestor_of(3, $childcat)) {
				echo $childcat->cat_ID;
				}}
				?>
				<!--Get IDs End-->                        
                        
                        
                          <!--Get IDs start-->	
				<?php
				foreach((get_the_category()) as $childcat) {
				if (cat_is_ancestor_of(3, $childcat)) {
				echo $childcat->cat_ID;
				}}
				?>
				<!--Get IDs End-->                        
                        


Post Categories