How to get Category Id from Post Id ?

You can try this code for getting category id from post id:

global $post;
$category_detail=get_the_category( $post->ID );

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)