Copy the template you want to change to a template called single-knowledge.php
. Then edit that to include your preferred sidebar instead of the “default” one. Whenever is_singular('knowledge')
is true, that template will be used. Make WordPress do the heavy lifting!!