This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Switching left/right sidebar places

  • Creator
  • #1619

    Is there a simple way to switch the left and right sidebar without editing the theme files?
    i.e. switching places between
    <?php get_sidebar( 'left' ); ?>
    <?php get_sidebar( 'right' ); ?>
    without editing, for example, index.php

    Reason is, while on mobile, on RTL websites, the left sidebar appears before the content, so user have to scroll down on every page. Which is annoying.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
  • #1634
    Jason Bobich

    In theory, you should be able to do this pretty easily. Keep in mind that the get_sidebar functions are just the default WP functions for pulling the template files.

    So, you’d copy sidebar-left.php and sidebar-right.php to your Child theme, and then switch their contents. Does that make sense?

    For example, in sidebar-left.php, you’d have:

    themeblvd_sidebars( 'right' );
    Jason Bobich

    Another cool approach you could take to this that would only use CSS would just be to re-order the content block and sidebars. This would only work on Android and iOS, and not Windows devices.

    @media (max-width: 767px) {
    	#sidebar_layout .row-fluid {
    		display: box;
    		display: -moz-box;
    		display: -webkit-box;
    		box-orient: vertical;
    		-moz-box-orient: vertical;
    		-webkit-box-orient: vertical;
    	#sidebar_layout #content {
    		box-ordinal-group: 1;
    		-moz-box-ordinal-group: 1;
    		-webkit-box-ordinal-group: 1;
    	#sidebar_layout .fixed-sidebar {
    		box-ordinal-group: 2;
    		-moz-box-ordinal-group: 2;
    		-webkit-box-ordinal-group: 2;

    Holy style sheets Batman!
    The box-ordinal-group CSS3 method works like a charm!
    You are THE man.
    And as for the mobile windows users, they can eat my shorts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.