Joshua David Nelson

Bullshit Free WordPress Development

  • Services
  • Code
  • About
  • Contact

Alternate Sidebar Page Template in Genesis

This allows you to use the built-in secondary sidebar as an alternate on one sidebar themes (you'll want to register a separate sidebar if you are using two sidebars in your theme layouts). This has a limited scope, I would recommend a plugin like Display Widgets if you are going to have a more complicated page-by-page application.

<?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.',
)
);
view raw functions.php hosted with ❤ by GitHub
<?php
/*
Template Name: Alt Sidebar Page
*/
add_action( 'genesis_sidebar', 'genesis_do_sidebar_alt' );
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
genesis();
view raw template-alt-sidebar.php hosted with ❤ by GitHub

Source: https://gist.github.com/joshuadavidnelson/7549996

Tags: Genesis, Page Template, Sidebar

Previous Code:
Remove Default WordPress Taxonomies
Back to the Code Snippets
Next Code:
Is_Custom_Post_Type()
  • Twitter
  • RSS Feed URL

About Me

I'm a WordPress Engineer. I build sleek, custom websites with WordPress and Genesis.

See my services and my recent work.

Contact me to get your project started.

Gravity Forms Plugin for WordPress Fastest WordPress Hosting

Recent Posts

  • Using Font Awesome Icons for WooCommerce Grid / List Toggle
  • Disable Blog: WordPress Gone Blog-less
  • Category (Taxonomy) Dropdown Filtered By Post Type
  • Weather in WordPress with Dark Sky
  • Fixing Your Deprecated Widget Constructors in WordPress 4.3
  • Twitter
  • RSS Feed URL
  • Code Snippets
  • My Plugins
  • Make a Payment

© Joshua David Nelson | Hand-Forged | WordPress + Genesis | Terms of Service | Legal | Contact