Not working with additional layouts registered in Genesis
-
I am using the Education theme. I needed to create an SecondarySidebar-Content layout (with no primary sidebar). I did so by adding the code below to the functions.php file:
//** Add sidebar-alt-content layout **// genesis_register_layout( 'sidebar-alt-content', array( 'label' => 'Small Sidebar/Content', 'img' => '/wp-content/themes/genesis/images/sidebar-alt-content.jpg', ) ); add_action('genesis_before', 'gt_new_custom_layout_logic'); function gt_new_custom_layout_logic() { $site_layout = genesis_site_layout(); if ( $site_layout == 'sidebar-alt-content.jpg' ) { // Remove default genesis sidebars remove_action( 'genesis_after_content', 'genesis_get_sidebar' ); remove_action( 'genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt'); add_action( 'genesis_before_content_sidebar_wrap', 'genesis_get_sidebar_alt' ); } }
It works great on posts and pages, but it doesn’t work with your plugin. The option shows up in the dropdown menu or in the layout selections, but selecting it resorts to the default. Your plugin is able to switch to all of the out-of-the-box Genesis layouts with no problem, tho.
Any ideas? Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Not working with additional layouts registered in Genesis’ is closed to new replies.