How to set active class to the menu of any page coming from a single.php template September 23, 2022 by Tarik Billa Update: Here is the answer: <?php if(is_single()) echo 'active'; ?>