Header funcs, blog style & search, image descs.
authorLaury GvR <laury@gaslightmedia.com>
Thu, 11 Dec 2014 20:50:33 +0000 (15:50 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 11 Dec 2014 20:50:33 +0000 (15:50 -0500)
12 files changed:
assets/img/default-header.png [new file with mode: 0644]
functions.php
home.php
index.php
nggallery/gallery-glmphotos.php
page-2027.php
page-73.php
page-75.php
page-97.php
page.php
scss/site/_structure.scss
search.php

diff --git a/assets/img/default-header.png b/assets/img/default-header.png
new file mode 100644 (file)
index 0000000..2af6889
Binary files /dev/null and b/assets/img/default-header.png differ
index 2d0fc86..a0a78a5 100644 (file)
@@ -43,5 +43,38 @@ function add_excerpts_to_pages() {
      add_post_type_support( 'page', 'excerpt' );
 }
 
+function SearchFilter($query) {
+    $searchType = $_GET["searchType"];
+    if ($searchType == 'blog') {
+        $query->set('post_type', 'post');
+    }
+    return $query;
+}
+add_filter('pre_get_posts','SearchFilter');
+
+
+function GLM_get_header() {
+    echo '<header';
+    
+    if (has_post_thumbnail()) {
+            $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
+            echo ' style="background: url('.$image_data[0].');min-height: '.$image_data[2].'px;';
+    } else {
+            echo ' style="background: url('.get_template_directory_uri().'/assets/img/default-header.png);min-height:400px;';
+    }
+    echo 'max-height: 400px; ">';
+    echo '<h1 class="entry-title">Sanctuary of the great lakes</h1>';
+    echo '</header>';
+    echo '<div class="row">';
+    echo '<div class="small-12 columns">';
+    echo the_breadcrumbs(">");
+    echo '</div>';
+    echo '</div>';
+}
+
+function custom_excerpt_length( $length ) {
+       return 200;
+}
+add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
 
 ?>
index ce9328c..1843e8f 100644 (file)
--- a/home.php
+++ b/home.php
@@ -1,24 +1,7 @@
 <?php get_header(); ?>
 <?php do_action('foundationPress_before_content'); ?>
 <article <?php post_class() ?> id="interior">
-        <header
-        <?php
-                if (has_post_thumbnail()) {
-                        $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
-                        echo ' style="background: url('.$image_data[0].'); min-height: '.$image_data[2].'px;max-height: 400px; "';
-                }
-                else {
-                        echo ' class="no-image"';
-                }
-        ?>
-        >
-                <h1 class="entry-title">Sanctuary of the great lakes</h1>
-        </header>
-        <div class="row">
-                <div class="small-12 columns">
-                        <?php the_breadcrumbs(">"); ?>
-                </div>
-        </div>
+        <?php GLM_get_header(); ?>
 </article>
 <div class="row">
     <div id="searchform_container" class="small-12 medium-3 columns alignright">
index ce9328c..4549519 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,33 +1,16 @@
 <?php get_header(); ?>
 <?php do_action('foundationPress_before_content'); ?>
 <article <?php post_class() ?> id="interior">
-        <header
-        <?php
-                if (has_post_thumbnail()) {
-                        $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
-                        echo ' style="background: url('.$image_data[0].'); min-height: '.$image_data[2].'px;max-height: 400px; "';
-                }
-                else {
-                        echo ' class="no-image"';
-                }
-        ?>
-        >
-                <h1 class="entry-title">Sanctuary of the great lakes</h1>
-        </header>
-        <div class="row">
-                <div class="small-12 columns">
-                        <?php the_breadcrumbs(">"); ?>
-                </div>
-        </div>
+    <?php GLM_get_header() ?>
 </article>
 <div class="row">
     <div id="searchform_container" class="small-12 medium-3 columns alignright">
-        <form id="searchform" action="<?php bloginfo('url'); ?>" method="get">
+        <form id="blogsearch" action="<?php bloginfo('url'); ?>" method="get">
             <div><input id="s" class="text" type="text" name="s" value="" />
             <input class="submit button blogbutton" type="submit" name="submit" value="Search" />
             <input type="hidden" name="searchType" value="blog" /> </div>
         </form>
-    </div>
+               </div>
     <div id="blog-posts-over" class="small-12 medium-9 columns">
         <?php $query = new WP_Query( 'showposts=5' ); ?>
         <?php if($query->have_posts()) : while($query->have_posts()): $query->the_post();?>
index b3f004f..f73b1ce 100644 (file)
@@ -38,23 +38,28 @@ Follow variables are useable :
        <?php foreach ( $images as $image ) : ?>
         <li>
             <div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box imgBorderMe" <?php echo $image->style ?> >
-                <!-- formerly ngg-gallery-thumbnails, stubborn ngg css classes force our hand -->
-                <a href="<?php echo nextgen_esc_url($image->imageURL) ?>"
+
+                <div class="ngg-gallery-thumbnail" >
+                    <a href="<?php echo nextgen_esc_url($image->imageURL) ?>"
+                title="<?php echo esc_attr($image->description) ?>"
                 data-src="<?php echo nextgen_esc_url($image->imageURL) ?>"
                 data-thumbnail="<?php echo nextgen_esc_url($image->thumbnailURL); ?>"
                 data-image-id="<?php echo esc_attr($image->pid); ?>"
+                data-title="<?php echo esc_attr($image->alttext); ?>"
                 data-description="<?php echo esc_attr($image->description); ?>"
+                data-url="<?php echo nggcf_get_field($image->pid, "url"); ?>"
                 data-front-description="<?php echo nggcf_get_field($image->pid, "Front Description"); ?>"
                 <?php echo $image->thumbcode ?> >
                             <?php if ( !$image->hidden ) { ?>
                         
                         <div class="image_overlay">
-                            <img src="<?php echo nextgen_esc_url($image->thumbnailURL) ?>" <?php echo $image->size ?> />
+                            <img title="<?php echo esc_attr($image->alttext) ?>" alt="<?php echo esc_attr($image->alttext) ?>" src="<?php echo nextgen_esc_url($image->thumbnailURL) ?>" <?php echo $image->size ?> />
                         </div>
-                    <span class="photoTitle"><?php if (!$image->hidden) { echo esc_attr($image->alttext); }?></span>
-                    <span class="photoHead"><?php if (!$image->hidden) { echo nggcf_get_field($image->pid, "Front Description"); } ?></span>
+                    <span class="photoTitle" title="<?php echo esc_attr($image->alttext) ?>"><?php if (!$image->hidden) { echo esc_attr($image->alttext); }?></span>
+                    <span class="photoHead" title="<?php echo esc_attr($image->alttext) ?>"><?php if (!$image->hidden) { echo nggcf_get_field($image->pid, "Front Description"); } ?></span>
                             <?php } ?>
                     </a>
+                </div>
                 
             </div>
         </li>
index 1a008b4..f5a610f 100644 (file)
@@ -5,24 +5,7 @@
 
 <?php while (have_posts()) : the_post(); ?>
     <article <?php post_class() ?> id="interior">
-        <header
-        <?php
-            if (has_post_thumbnail()) {
-                    $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
-                    echo ' style="background: url('.$image_data[0].'); min-height: '.$image_data[2].'px;"';
-            }
-            else {
-                    echo ' class="no-image"';
-            }
-        ?>
-        >
-            <h1 class="entry-title">Sanctuary of the great lakes</h1>
-        </header>
-        <div class="row">
-            <div class="small-12 columns">
-                    <?php the_breadcrumbs(">"); ?>
-            </div>
-        </div>
+        <?php GLM_get_header(); ?>
         <div class="row">
             <div class="small-12 columns">
                 <?php do_action('foundationPress_page_before_entry_content'); ?>
index e5a6d8f..281a9f2 100644 (file)
@@ -5,24 +5,7 @@
 
 <?php while (have_posts()) : the_post(); ?>
     <article <?php post_class() ?> id="interior">
-        <header
-        <?php
-            if (has_post_thumbnail()) {
-                    $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
-                    echo ' style="background: url('.$image_data[0].'); min-height: '.$image_data[2].'px;"';
-            }
-            else {
-                    echo ' class="no-image"';
-            }
-        ?>
-        >
-            <h1 class="entry-title">Sanctuary of the great lakes</h1>
-        </header>
-        <div class="row">
-            <div class="small-12 columns">
-                    <?php the_breadcrumbs(">"); ?>
-            </div>
-        </div>
+        <?php GLM_get_header(); ?>
         <div class="row">
             <div class="small-12 columns">
                 <?php do_action('foundationPress_page_before_entry_content'); ?>
index 6c82d6f..c620976 100644 (file)
@@ -5,24 +5,7 @@
 
 <?php while (have_posts()) : the_post(); ?>
     <article <?php post_class() ?> id="interior">
-        <header
-        <?php
-            if (has_post_thumbnail()) {
-                    $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
-                    echo ' style="background: url('.$image_data[0].'); min-height: '.$image_data[2].'px;"';
-            }
-            else {
-                    echo ' class="no-image"';
-            }
-        ?>
-        >
-            <h1 class="entry-title">Sanctuary of the great lakes</h1>
-        </header>
-        <div class="row">
-            <div class="small-12 columns">
-                    <?php the_breadcrumbs(">"); ?>
-            </div>
-        </div>
+        <?php GLM_get_header(); ?>
         <div class="row">
             <div class="small-12 columns">
                 <?php do_action('foundationPress_page_before_entry_content'); ?>
index 1a008b4..f5a610f 100644 (file)
@@ -5,24 +5,7 @@
 
 <?php while (have_posts()) : the_post(); ?>
     <article <?php post_class() ?> id="interior">
-        <header
-        <?php
-            if (has_post_thumbnail()) {
-                    $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
-                    echo ' style="background: url('.$image_data[0].'); min-height: '.$image_data[2].'px;"';
-            }
-            else {
-                    echo ' class="no-image"';
-            }
-        ?>
-        >
-            <h1 class="entry-title">Sanctuary of the great lakes</h1>
-        </header>
-        <div class="row">
-            <div class="small-12 columns">
-                    <?php the_breadcrumbs(">"); ?>
-            </div>
-        </div>
+        <?php GLM_get_header(); ?>
         <div class="row">
             <div class="small-12 columns">
                 <?php do_action('foundationPress_page_before_entry_content'); ?>
index 717aaa6..b653e3b 100644 (file)
--- a/page.php
+++ b/page.php
@@ -4,24 +4,7 @@
 
        <?php while (have_posts()) : the_post(); ?>
                <article <?php post_class() ?> id="interior">
-                       <header
-                       <?php
-                               if (has_post_thumbnail()) {
-                                       $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
-                                       echo ' style="background: url('.$image_data[0].'); min-height: '.$image_data[2].'px;max-height: 400px; "';
-                               }
-                               else {
-                                       echo ' class="no-image"';
-                               }
-                       ?>
-                       >
-                               <h1 class="entry-title">Sanctuary of the great lakes</h1>
-                       </header>
-                       <div class="row">
-                               <div class="small-12 columns">
-                                       <?php the_breadcrumbs(">"); ?>
-                               </div>
-                       </div>
+                       <?php GLM_get_header(); ?>
                        <div class="row">
                                <div class="small-12 columns">
                                        <?php do_action('foundationPress_page_before_entry_content'); ?>
index 27dcc76..1fbd83f 100644 (file)
@@ -1075,7 +1075,7 @@ footer {
      * 4.7 Blog
      * -----------------------------------
      */
-    #blog-posts-over {
+    #blog-posts-container {
         box-shadow: 1px 1px 10px 0px rgba(0, 0, 0, 0.75);
         margin: 30px 0 60px 0;
         h2 {
index 6579aa7..55dd264 100644 (file)
@@ -1,35 +1,88 @@
+
+    
 <?php get_header(); ?>
-<div class="row">
-       <div class="small-12 large-8 columns" role="main">
+<?php do_action('foundationPress_before_content'); ?>
 
-               <?php do_action('foundationPress_before_content'); ?>
+<article <?php post_class() ?> id="interior">
+        <?php GLM_get_header(); ?>
+</article>    
+<div class="row">
+    <h2><?php _e('Search Results for', 'FoundationPress'); ?> "<?php echo get_search_query(); ?>"</h2>
+    <div id="blog-posts-over" class="small-12 columns">
 
-               <h2><?php _e('Search Results for', 'FoundationPress'); ?> "<?php echo get_search_query(); ?>"</h2>
+        <?php $query = new WP_Query( 'showposts=5' ); ?>
+        <?php if(have_posts()) : while(have_posts()): the_post();?>
+        <div class="row content" id="blog-posts-container">
+            <div class="small-11 small-centered columns">
+                <div class="row">
+                    <div class="small-12 columns">
+                        <ul class="breadcrumbs">
 
-       <?php if ( have_posts() ) : ?>
+                        </ul>
+                    </div>
+                </div>
+                <div class="row">
+                    <div class="small-12 columns">
 
-               <?php while ( have_posts() ) : the_post(); ?>
-                       <?php get_template_part( 'content', get_post_format() ); ?>
-               <?php endwhile; ?>
+                        <article id="<?php the_ID()?>" <?php post_class()?>>
+                            <header class="entry-header">
+                                <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
+                            </header>
+                            <?php the_post_thumbnail(); ?>
+                            <?php echo the_advanced_excerpt('length=200&length_type=words&no_custom=1&ellipsis=%26hellip;'); ?>
+                            <footer class="entry-meta small-12 medium-6 medium-push-3 center">
+                                
+                                <?php $post_categories = wp_get_post_categories( get_the_ID() );
+                                $cats = array();
 
-               <?php else : ?>
-                       <?php get_template_part( 'content', 'none' ); ?>
+                                echo 'This entry was posted ';
+                                if (has_category()) {
+                                    echo 'in ';
+                                    foreach($post_categories as $c){
 
-       <?php endif;?>
+                                        $cat = get_category( $c );
+                                        $cats[] = array( 'name' => $cat->name, 'slug' => $cat->slug );
+                                        echo '<a rel="category" title="View all posts in '. $cat->name . ' " href="'. $cat->slug .'">'. $cat->name .'</a>, ';
+                                    }
+                                }
+                                $post_tags = wp_get_post_tags( get_the_ID() );
+                                $tags = array();
+                                if (has_tag( )) {
+                                    echo ' and tagged ';
+                                    foreach($post_tags as $t){
+                                        $tag = get_tag( $t );
+                                        $tags[] = array( 'name' => $tag->name, 'slug' => $tag->slug );
+                                        echo '<a rel="category" title="View all posts in '. $tag->name . ' " href="'. $tag->slug .'">'. $tag->name .'</a>, ';
+                                    }
+                                }
+                                
+                                echo ' on ';
+                                echo ' <span class="meta date"> ' . the_time('F jS, Y') . '. </span>';
+                                ?>
 
-       <?php do_action('foundationPress_before_pagination'); ?>
+                            </footer>
+                            <hr>
+                        </article>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <?php endwhile; ?>
+        <?php do_action('foundationPress_before_pagination'); ?>
 
-       <?php if ( function_exists('FoundationPress_pagination') ) { FoundationPress_pagination(); } else if ( is_paged() ) { ?>
+       
+        <?php if ( function_exists('FoundationPress_pagination') ) { FoundationPress_pagination(); } else if ( is_paged() ) { ?>
 
                <nav id="post-nav">
                        <div class="post-previous"><?php next_posts_link( __( '&larr; Older posts', 'FoundationPress' ) ); ?></div>
                        <div class="post-next"><?php previous_posts_link( __( 'Newer posts &rarr;', 'FoundationPress' ) ); ?></div>
                </nav>
        <?php } ?>
-
-       <?php do_action('foundationPress_after_content'); ?>
-
-       </div>
-       <?php //get_sidebar(); ?>
-
-<?php get_footer(); ?>
+        <?php else: ?>
+        <div id="post-404" class="noposts">
+                <p><?php _e('Sorry, no posts yet');?></p>
+        </div><!-- /#post-404 -->
+        <?php endif;?>
+    </div>
+    <div class="row content small-12 medium-3">
+        <?php get_footer(); ?>