Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Alternative Sidebar Page Template in Genesis. The default description for the built-in secondary sidebar doesn't really apply, so first we'll unregister that sidebar and re-register it with our preferred description. Then create a new page template, called something like template-alt-sidebar.php for instance. Now you'll see the secondary sidebar…
<?php
/**
* Place this into your functions file
*
*/
unregister_sidebar( 'sidebar-alt' );
genesis_register_sidebar(
array(
'id' => 'sidebar-alt',
'name' => 'Alternate Sidebar',
'description' => 'This sidebar will appear instead of the primary sidebar, when the alternate sidebar page template is used.',
)
);
<?php
/*
Template Name: Alt Sidebar Page
*/
add_action( 'genesis_sidebar', 'genesis_do_sidebar_alt' );
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.