toggle menu

Get Condition for the taxanomy page

Dhananjay Kumar |15 Nov at 06:11


$queried_object = get_queried_object();
 
$page_title = '';
if ( $queried_object instanceof \WP_Term ) {
$page_title = $queried_object->name;
} elseif ( $queried_object instanceof \WP_Post_Type ) {
$page_title = $queried_object->label;
}

 

  • 1 like
  • 0 comment

Posted:

15 Nov at 06:11

Viewed:

723 times

Active:

15 Nov at 06:11