Move Sidebar Above Content

When making a mobile responsive website, it is common to make the content and sidebar go full width and stack on mobile devices. If you have something important in your sidebar, like your site’s menu, this code will move the sidebar above the content area. When they go full width and stack, the sidebar will be on top.

<?php
/**
* Move Sidebar above Content
*
* @author Bill Erickson
* @link http://www.billerickson.net/code/move-sidebar-content/
*/
remove_action( 'genesis_after_content', 'genesis_get_sidebar' );
add_action( 'genesis_before_content', 'genesis_get_sidebar' );
view raw functions.php hosted with ❤ by GitHub

Bill Erickson

Bill Erickson is the co-founder and lead developer at CultivateWP, a WordPress agency focusing on high performance sites for web publishers.

About Me
Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk