From: Ian Weller Date: Wed, 26 Oct 2016 15:25:15 +0000 (-0400) Subject: breaking it down to usable chunks X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=0a6d3c872069cb2a82a4e90875ef51bbba60c1f4;p=web%2FGruntInit%2FglmTheme.git breaking it down to usable chunks I broke down the index.php file to work in a sections folder. It almost looks like the glmThemeV6. --- diff --git a/root/index.php b/root/index.php index 77417cc..3f0fbc4 100644 --- a/root/index.php +++ b/root/index.php @@ -1,536 +1,43 @@ - - - - - - - - - - <?php wp_title(); ?> - - - - - - -
-
-
- - - -
-
- -
- -
- - - - - - - - - - - - - - - - - -
-
- -
-
-
- -
-
- - -
- -
- -
-
-
- - - - -
- -
- - -
-
- - - - -
-
- - -
-
- - - - -
-
-
- -
-
-
-
- - -
-
-
-
- - -
-

-
- -
- -
-
- - - - -
-
- -

Please enter a query in the search box.

- -

Search Results for ""

-
- -
-
- - post_type=='page')) continue; ?> -
-
-
> -
-

- Posted on -
- - - - @'), array(' ', "\n"), apply_filters('the_content', $post->post_content))) : ''); - - // Search content for terms - $terms = $wp_query->query_vars['search_terms']; - if ( preg_match_all('/'.str_replace('/', '\/', join('|', $terms)).'/i', $content, $matches, PREG_OFFSET_CAPTURE) ) { - $padding = max($min_padding, $max_length / (2*count($matches[0]))); - - // Construct extract containing context for each term - $output = ''; - $last_offset = 0; - foreach ( $matches[0] as $match ) { - list($string, $offset) = $match; - $start = $offset-$padding; - $end = $offset+strlen($string)+$padding; - // Preserve whole words - while ( $start > 1 && preg_match('/[A-Za-z0-9\'"-]/', $content{$start-1}) ) $start--; - while ( $end < strlen($content)-1 && preg_match('/[A-Za-z0-9\'"-]/', $content{$end}) ) $end++; - $start = max($start, $last_offset); - $context = substr($content, $start, $end-$start); - if ( $start > $last_offset ) $context = '...'.$context; - $output .= $context; - $last_offset = $end; - } - - if ( $last_offset != strlen($content)-1 ) $output .= '...'; - } else { - $output = $content; - } - - if ( strlen($output) > $max_length ) { - $end = $max_length-3; - while ( $end > 1 && preg_match('/[A-Za-z0-9\'"-]/', $output{$end-1}) ) $end--; - $output = substr($output, 0, $end) . '...'; - } - - // Highlight matches - $context = nl2br(preg_replace('/'.str_replace('/', '\/', join('|', $terms)).'/i', '$0', $output)); - ?> - -

- -

-

- Read this entry -

- - - -
- $cat->name, 'slug' => $cat->slug ); - echo ', '. $cat->name .''; - } - echo '.'; - } - ?> -
-
-
-
- - - -
-

-
- -
- - -
-
- - - - -
-
-
- "; - bcn_display(); - echo "
"; - } - ?> -
-
- - -
-
- - - - - - -
- - - -
- -
-
- - - - -
- -
- - - - - - - - - - - - \ No newline at end of file + + + +
+
+
+ +
+ +
+
+ + + + + + \ No newline at end of file diff --git a/root/parts/header-meta.php b/root/parts/header-meta.php new file mode 100644 index 0000000..439c6d1 --- /dev/null +++ b/root/parts/header-meta.php @@ -0,0 +1,8 @@ + + + + <?php wp_title(); ?> + + + + \ No newline at end of file diff --git a/root/sections/blog-archive.php b/root/sections/blog-archive.php new file mode 100644 index 0000000..32313d2 --- /dev/null +++ b/root/sections/blog-archive.php @@ -0,0 +1,6 @@ +
+
+ + +
+
\ No newline at end of file diff --git a/root/sections/blog-home.php b/root/sections/blog-home.php new file mode 100644 index 0000000..01d5da8 --- /dev/null +++ b/root/sections/blog-home.php @@ -0,0 +1,9 @@ +
+ +
+ + +
+
\ No newline at end of file diff --git a/root/sections/blog-single.php b/root/sections/blog-single.php new file mode 100644 index 0000000..55bb278 --- /dev/null +++ b/root/sections/blog-single.php @@ -0,0 +1,26 @@ +
+
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+

+
+ +
+ +
+
\ No newline at end of file diff --git a/root/sections/copyright.php b/root/sections/copyright.php new file mode 100644 index 0000000..a2380e2 --- /dev/null +++ b/root/sections/copyright.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/root/sections/footer.php b/root/sections/footer.php new file mode 100644 index 0000000..f52e0d7 --- /dev/null +++ b/root/sections/footer.php @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/root/sections/front-page.php b/root/sections/front-page.php new file mode 100644 index 0000000..84d36de --- /dev/null +++ b/root/sections/front-page.php @@ -0,0 +1,20 @@ +
+
+ +
+
+
+ +
+
+ + +
+ +
+ +
+
+
\ No newline at end of file diff --git a/root/sections/header.php b/root/sections/header.php new file mode 100644 index 0000000..38be909 --- /dev/null +++ b/root/sections/header.php @@ -0,0 +1,19 @@ +
+
+
+ + + +

+ +

+ +

+ +
+
+
\ No newline at end of file diff --git a/root/sections/interior-page.php b/root/sections/interior-page.php new file mode 100644 index 0000000..cc77ca0 --- /dev/null +++ b/root/sections/interior-page.php @@ -0,0 +1,21 @@ +
+
+
+ "; + bcn_display(); + echo "
"; + } + ?> +
+
+ + +
+ +
\ No newline at end of file diff --git a/root/sections/off-canvas.php b/root/sections/off-canvas.php new file mode 100644 index 0000000..87de2dd --- /dev/null +++ b/root/sections/off-canvas.php @@ -0,0 +1,38 @@ + + \ No newline at end of file diff --git a/root/sections/search.php b/root/sections/search.php new file mode 100644 index 0000000..16c6b6e --- /dev/null +++ b/root/sections/search.php @@ -0,0 +1,110 @@ +
+
+ +

Please enter a query in the search box.

+ +

Search Results for ""

+
+ +
+
+ + post_type=='page')) continue; ?> +
+
+
> +
+

+ Posted on +
+ + + + @'), array(' ', "\n"), apply_filters('the_content', $post->post_content))) : ''); + + // Search content for terms + $terms = $wp_query->query_vars['search_terms']; + if ( preg_match_all('/'.str_replace('/', '\/', join('|', $terms)).'/i', $content, $matches, PREG_OFFSET_CAPTURE) ) { + $padding = max($min_padding, $max_length / (2*count($matches[0]))); + + // Construct extract containing context for each term + $output = ''; + $last_offset = 0; + foreach ( $matches[0] as $match ) { + list($string, $offset) = $match; + $start = $offset-$padding; + $end = $offset+strlen($string)+$padding; + // Preserve whole words + while ( $start > 1 && preg_match('/[A-Za-z0-9\'"-]/', $content{$start-1}) ) $start--; + while ( $end < strlen($content)-1 && preg_match('/[A-Za-z0-9\'"-]/', $content{$end}) ) $end++; + $start = max($start, $last_offset); + $context = substr($content, $start, $end-$start); + if ( $start > $last_offset ) $context = '...'.$context; + $output .= $context; + $last_offset = $end; + } + + if ( $last_offset != strlen($content)-1 ) $output .= '...'; + } else { + $output = $content; + } + + if ( strlen($output) > $max_length ) { + $end = $max_length-3; + while ( $end > 1 && preg_match('/[A-Za-z0-9\'"-]/', $output{$end-1}) ) $end--; + $output = substr($output, 0, $end) . '...'; + } + + // Highlight matches + $context = nl2br(preg_replace('/'.str_replace('/', '\/', join('|', $terms)).'/i', '$0', $output)); + ?> + +

+ +

+

+ Read this entry +

+ + + +
+ $cat->name, 'slug' => $cat->slug ); + echo ', '. $cat->name .''; + } + echo '.'; + } + ?> +
+
+
+
+ + + +
+

+
+ +
+ + +
+
\ No newline at end of file diff --git a/root/sections/top-bar.php b/root/sections/top-bar.php new file mode 100644 index 0000000..36a5d22 --- /dev/null +++ b/root/sections/top-bar.php @@ -0,0 +1,10 @@ + + \ No newline at end of file