From 3f0ec3e01bfe389211fcd76b323af7c48cc51250 Mon Sep 17 00:00:00 2001 From: andrewmbacon Date: Thu, 26 Jun 2014 08:53:02 -0400 Subject: [PATCH] Cleaning Up for Development Removed on screen comments Enabled sidebars Enabled page specific sidebars Added div for widget content vs widget header. Adjusted blog nav --- archive.php | 189 +++++++++++++++++++++--------------------- content.php | 1 - inc/extras.php | 2 +- inc/reg-sidebars.php | 35 +++++++- inc/template-tags.php | 8 +- index.php | 32 +------ page.php | 11 +-- search.php | 37 +-------- sidebar.php | 4 +- single.php | 48 ++++++----- style.css | 40 +++++++-- style.scss | 52 +++++++++--- 12 files changed, 241 insertions(+), 218 deletions(-) diff --git a/archive.php b/archive.php index ca9aa3b..9278675 100755 --- a/archive.php +++ b/archive.php @@ -8,98 +8,101 @@ */ get_header(); ?> -

archive.php

-
-
+
+
+
+
+ + + +
', $term_description ); + endif; + ?> + + + + + + + + + + + + + + + + + +
+
+ + + - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content.php b/content.php index f7d45a5..97c8737 100755 --- a/content.php +++ b/content.php @@ -5,7 +5,6 @@ */ ?> -

Content.php

>
', esc_url( get_permalink() ) ), '' ); ?> diff --git a/inc/extras.php b/inc/extras.php index b0478bc..6b556f8 100755 --- a/inc/extras.php +++ b/inc/extras.php @@ -86,4 +86,4 @@ function cs_setup_author() { $GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author ); } } -add_action( 'wp', 'cs_setup_author' ); +add_action( 'wp', 'cs_setup_author' ); \ No newline at end of file diff --git a/inc/reg-sidebars.php b/inc/reg-sidebars.php index 7535e5c..4257f99 100644 --- a/inc/reg-sidebars.php +++ b/inc/reg-sidebars.php @@ -8,10 +8,14 @@ if ( function_exists('register_sidebar') ) { register_sidebar(array( - 'name' => 'Sidebar', - 'id' => 'sidebar', - 'before_title' => '

', - 'after_title' => '

', + 'name' => __( 'Sidebar', 'theme_text_domain' ), + 'id' => 'sidebar', + 'description' => 'Appears with Archives, Search Results, the Blog page template, and when viewing single posts.', + 'class' => 'sidebar', + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

' )); register_sidebar(array( 'name' => 'Home1', @@ -69,6 +73,29 @@ )); } +register_sidebar( array( + 'name' => __( 'Header Widget Area', 'theme' ), + 'id' => 'header-widget-area', + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', +) ); + +// if no title then add widget content wrapper to before widget +add_filter( 'dynamic_sidebar_params', 'check_sidebar_params' ); +function check_sidebar_params( $params ) { + global $wp_registered_widgets; + + $settings_getter = $wp_registered_widgets[ $params[0]['widget_id'] ]['callback'][0]; + $settings = $settings_getter->get_settings(); + $settings = $settings[ $params[1]['number'] ]; + + if ( $params[0][ 'after_widget' ] == '
' && isset( $settings[ 'title' ] ) && empty( $settings[ 'title' ] ) ) + $params[0][ 'before_widget' ] .= '
'; + + return $params; +} ?> \ No newline at end of file diff --git a/inc/template-tags.php b/inc/template-tags.php index 02c4e80..f11c464 100755 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -18,7 +18,6 @@ function cs_paging_nav() { } ?>
'; - dynamic_sidebar( $sidebar ); - echo ''; - } ?> + if ( is_active_sidebar( $sidebar ) ) { + echo '
'; + dynamic_sidebar( $sidebar ); + echo '
'; + } + ?> \ No newline at end of file diff --git a/search.php b/search.php index 27c0822..32d7eea 100755 --- a/search.php +++ b/search.php @@ -6,26 +6,9 @@ */ get_header(); ?> -

search.php

- -
- -
@@ -53,25 +36,7 @@
- - - -
- -
- +
diff --git a/sidebar.php b/sidebar.php index 09698c8..507b357 100755 --- a/sidebar.php +++ b/sidebar.php @@ -5,8 +5,8 @@ * @package cornerstone */ ?> -