Get WordPress Custom Post Taxonomy Categories and Tags

Here's another problem with WordPress post where you want to know whether a particular custom post has a particular taxonomy categories or tags. In a normal post cast, you will highly likely used either get_categories or get_terms but for custom post type you might need to use another method which is what i am using currently as well. In order to determine whether a post category or tag is used by your custom post type, try the following

$terms = wp_get_object_terms($post->ID, 'review_category');

The first parameter is obviously the post id but the second parameter here is actually the custom post type taxonomy which you can find on your custom post type 'categories' section (on the url). Once you have determine your taxonomy name, getting post taxonomy categories or tags should be a piece of cake.

Check Whether a page is using WordPress Custom Taxonomy Category

Well, today i faced a little problem on checking whether a page displaying on WordPress site is using a custom taxonomy post type. I need to determine whether that particular page is using a custom taxonomy post type and that particular page is using a particular custom taxonomy post category as well. In this case, i search a bit but couldn't find this answer easily which resulted me to write this in the case i need this in the future as well.

In order to find whether a particular page is a custom taxonomy category type, we test with the following sentence

 if(is_single()){
          } else if(is_tax('reviews', $term = 'Games')){
            $args = array( 'post_type' => 'reviews', 'showposts' => 72, 'tax_query' => array(
		array(
			'taxonomy' => 'review_category',
			'field' => 'slug',
			'terms' => 'games'
		)
            ) );
          }else if(is_tax('reviews', $term = 'Apps')){
            $args = array( 'post_type' => 'reviews', 'showposts' => 72, 'tax_query' => array(
		array(
			'taxonomy' => 'review_category',
			'field' => 'slug',
			'terms' => 'apps'
		)
            ) );
          }else
            $args = array( 'post_type' => 'reviews', 'showposts' => 72);

My custom taxonomy is 'reviews' and i wanted to check whether a particular page is type 'Apps' or 'Games', this way i am able to determine whether the particular page is using a custom taxonomy category which is different from using is_category which check post category.