Notice: Undefined variable: string in /home/u665484253/domains/wpcodekit.com/public_html/wp-content/themes/twentytwenty-child/functions.php on line 61
Get Category name from Post ID
$category_detail=get_the_category('4');//$post->ID foreach($category_detail as $cd){ echo $cd->cat_name; }