I am calling the typical get_sidebar()
method to produce a vertical sidebar on posts/pages. Because of the responsive and multiple format nature of our site, the designer decided to make full-width content posts/pages with no sidebar, but using the same sidebar content below the content, in a horizontal fashion (utilizing bootstrap's grid). Is it possible to use one sidebar instance, and conditionally output multiple formats from the elements of the sidebar?
Asked
Viewed
22 times
0
get_sidebar
is just a thin wrapper aroundget_template_part
, look inside thesidebar.php
of your theme for the actual code that loads the widgets – Tom J Nowell♦ Apr 4 '18 at 16:56get_template_part()
is viable that would totally work. – cj5 Apr 4 '18 at 17:02dynamic_sidebar
. Eitherway I still think the fundamental issue is you're relying on HTML classes to define grids/columns, rather than using CSS to assign them from the stylesheets. SCSS/LESS would make this trivial, all you'd have to do is wrap it in a div with a class you could use to flip between the two formats. Else you're probably going to need to create a whole new sidebar and duplicate all the widgets so that you can change their before and after markup – Tom J Nowell♦ Apr 4 '18 at 17:05