Many thanks for your suggestions. When I tried the first one however, the variable wasn’t recognised (I wonder if that’s because it’s internal to the theme code?). I’ll investigate your second suggestion.