I suppose you mean you are using the same site template for both Parent and Children pages? Then some logic might work.
I will assume Parent Ids are : 4, 8, 9, 11, 34, 345 ..
<div id="sidebar">
[[*id:is=`4`:or:is=`8`:or:is=`9`:or:is=`11`:then=`[[$Inthissection]]`:else=``]]
//even better, use the bellow:
[[[[*id:is=`4`:or:is=`8`:or:is=`9`:or:is=`11`:then=`$Inthissection`:else=``]]]]
[[Wayfinder? &startId=`[[*id]]` &level=`1` &outerClass=`submenu` &scheme=`full`]]
</div>
If Page 4, or 8 or 9 is being viewed, this chunk will show, [[$Inthissection]], which is your heading with CSS attached.
4, 8 and 9 being parents, Wayfinder will have some children to show, because the [[*id]] in the Wayfinder call will change to 4, or 8 or 9, and Wayfinder will start processing from that Id.
If Page 200 (a non-parent, but a child of 8 ) is being viewed, the [[*id]] will change to 200 but Wayfinder will have no children and nothing to show. So your <div id="sidebar"></div> will be nice and blank.
You could of course write a snippet to take care of this and also prevent Wayfinder from being called at all when not needed.
Hope this is a start to your answer..
Cheers