From 108222b383bad2c54921d823a9d7a9989891e920 Mon Sep 17 00:00:00 2001 From: Stef Kariotidis Date: Sat, 5 Nov 2016 14:34:48 +0200 Subject: [PATCH] register left-right templates, WP coding standards --- inc/widgets.php | 90 ++++++++++++++++++++++++++--------------------- sidebar-left.php | 22 ++++++++++++ sidebar-right.php | 22 ++++++++++++ 3 files changed, 94 insertions(+), 40 deletions(-) create mode 100644 sidebar-left.php create mode 100644 sidebar-right.php diff --git a/inc/widgets.php b/inc/widgets.php index 1088ced..66cce3b 100644 --- a/inc/widgets.php +++ b/inc/widgets.php @@ -5,48 +5,58 @@ * * @package understrap */ -if ( ! function_exists ( 'understrap_widgets_init' ) ) { - function understrap_widgets_init() { - register_sidebar( array( - 'name' => __( 'Sidebar', 'understrap' ), - 'id' => 'sidebar-1', - 'description' => 'Sidebar widget area', - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - ) ); +if ( ! function_exists( 'understrap_widgets_init' ) ) { + function understrap_widgets_init() { + register_sidebar( array( + 'name' => __( 'Right Sidebar', 'understrap' ), + 'id' => 'right-sidebar', + 'description' => 'Right sidebar widget area', + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) ); - register_sidebar( array( - 'name' => __( 'Hero Slider', 'understrap' ), - 'id' => 'hero', - 'description' => 'Hero slider area. Place two or more widgets here and they will slide!', - 'before_widget' => '
', - 'after_widget' => '
', - 'before_title' => '', - 'after_title' => '', - ) ); + register_sidebar( array( + 'name' => __( 'Left Sidebar', 'understrap' ), + 'id' => 'left-sidebar', + 'description' => 'Left sidebar widget area', + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) ); - register_sidebar( array( - 'name' => __( 'Hero Static', 'understrap' ), - 'id' => 'statichero', - 'description' => 'Static Hero widget. no slider functionallity', - 'before_widget' => '', - 'after_widget' => '', - 'before_title' => '', - 'after_title' => '', - ) ); + register_sidebar( array( + 'name' => __( 'Hero Slider', 'understrap' ), + 'id' => 'hero', + 'description' => 'Hero slider area. Place two or more widgets here and they will slide!', + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '', + 'after_title' => '', + ) ); - register_sidebar( array( - 'name' => __( 'Footer Full', 'understrap' ), - 'id' => 'footerfull', - 'description' => 'Widget area below main content and above footer', - 'before_widget' => '', - 'after_widget' => '', - 'before_title' => '', - 'after_title' => '', - ) ); + register_sidebar( array( + 'name' => __( 'Hero Static', 'understrap' ), + 'id' => 'statichero', + 'description' => 'Static Hero widget. no slider functionallity', + 'before_widget' => '', + 'after_widget' => '', + 'before_title' => '', + 'after_title' => '', + ) ); - } + register_sidebar( array( + 'name' => __( 'Footer Full', 'understrap' ), + 'id' => 'footerfull', + 'description' => 'Widget area below main content and above footer', + 'before_widget' => '', + 'after_widget' => '', + 'before_title' => '', + 'after_title' => '', + ) ); + + } } -add_action( 'widgets_init', 'understrap_widgets_init' ); \ No newline at end of file +add_action( 'widgets_init', 'understrap_widgets_init' ); diff --git a/sidebar-left.php b/sidebar-left.php new file mode 100644 index 0000000..4a4b3ad --- /dev/null +++ b/sidebar-left.php @@ -0,0 +1,22 @@ + + + +