Home / Archive / Show Left Sidebar Before Content on Mobile
Duplicate Snippet

Embed Snippet on Your Site

Show Left Sidebar Before Content on Mobile

By default the sidebar always displays below the content on mobile. This code will allow you to display the left sidebar above your content on mobile.

Code Preview
php
<?php
add_action( 'init', function() {
	if ( function_exists( 'wpex_content_area_layout' ) && 'left-sidebar' === wpex_content_area_layout() ) {
    	remove_action( 'wpex_hook_primary_after', 'wpex_get_sidebar_template' );
		add_action( 'wpex_hook_primary_before', 'wpex_get_sidebar_template' );
	}
} );

Comments

Add a Comment