You can simply follow steps and add active class in your navigation using PHP Step1: In Header page Modified navigation…