Skip to content

Instantly share code, notes, and snippets.

@joshuadavidnelson
Created November 19, 2013 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuadavidnelson/7549996 to your computer and use it in GitHub Desktop.
Save joshuadavidnelson/7549996 to your computer and use it in GitHub Desktop.
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