Hello,
Do you want to show the sidebar on the shop page but hide for some category or hide the sidebar on the shop page and show for some category only? Because code will be different in these 2 variants.
Or it would be better to add the sidebar position option for every category in categories settings, for example http://prntscr.com/hxziax ?
Regards