//Declare on top global $post; $category = get_queried_object(); //Add into post list query // $category->name // $category->slug // $category->term_id 'cat' => $category->term_id //OR 'your texonomy name' => $category->term_id,
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter