Joke attempt to trap detective giving expert opinion (8)
I believe the answer is:
punditry
'expert opinion' is the definition.
(I've seen this before)
'joke attempt to trap detective' is the wordplay.
'joke' becomes 'pun' (pun is a type of joke).
'attempt to' becomes 'try' (I've seen this in other clues).
'trap' is an insertion indicator.
'detective' becomes 'di' (Detective Inspector abbreviation).
'pun'+'try'='puntry'
'puntry' placed around 'di' is 'PUNDITRY'.
'giving' is the link.
(Other definitions for punditry that I've seen before include "The giving of expert opinions" , "The ability to speak authoritatively on a subject" , "display of expertise" , "expert opinion" .)