Skip to content

Instantly share code, notes, and snippets.

@craigsimps
Last active December 23, 2015 18:26
Show Gist options
  • Save craigsimps/62084993b5061fa2f750 to your computer and use it in GitHub Desktop.
Save craigsimps/62084993b5061fa2f750 to your computer and use it in GitHub Desktop.
Refactor code to register multiple widget area from Parallax Pro theme.
<?php
/**
* Register sidebars.
*
* @author Craig Simpson <craig@designed2.co.uk>
* @package Genesis_Starter_Theme
* @since 1.0.0 Initial Commit
*/
$sidebars = [
[
'id' => 'home-section-1',
'name' => __( 'Home Section 1', 'parallax' ),
'description' => __( 'This is the home section 1 section.', 'parallax' ),
],
[
'id' => 'home-section-2',
'name' => __( 'Home Section 2', 'parallax' ),
'description' => __( 'This is the home section 2 section.', 'parallax' ),
],
[
'id' => 'home-section-3',
'name' => __( 'Home Section 3', 'parallax' ),
'description' => __( 'This is the home section 3 section.', 'parallax' ),
],
[
'id' => 'home-section-4',
'name' => __( 'Home Section 4', 'parallax' ),
'description' => __( 'This is the home section 4 section.', 'parallax' ),
],
[
'id' => 'home-section-5',
'name' => __( 'Home Section 5', 'parallax' ),
'description' => __( 'This is the home section 5 section.', 'parallax' ),
],
[
'id' => 'after-entry',
'name' => __( 'After Entry', 'parallax' ),
'description' => __( 'This is the after entry widget area.', 'parallax' ),
],
];
array_walk( $sidebars, function( $sidebar ) {
genesis_register_sidebar( $sidebar );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment