Store display_sidebar in static variable
Merge pull request #1196 from QWp6t/master

Store display_sidebar in static variable