Skip to content

Snippet: Move Sidebar Above Content On Mobile

// Move sidebar before content so it displays at the top on mobile
add_action( 'init', function() {
    remove_action( 'wpex_hook_primary_after', 'wpex_get_sidebar_template' );
    add_action( 'wpex_hook_primary_before', 'wpex_get_sidebar_template' );
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top