Dynamic CPT / Taxonomy

If your custom taxonomies are unique to the custom post type, then you can set post type to an array ie post_type => array('cpt1', 'cpt2'), knowing that the taxonomy filter will only return the relevant post types.

Secondly, in your tax_query, change catcocktails to get_queried_object()->taxonomy which will make it “dynamic”.

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