How to get Category Id from Post Id ? April 16, 2022 by Tarik Billa You can try this code for getting category id from post id: global $post; $category_detail=get_the_category( $post->ID );