Adding missing blog parts
authorIan Weller <ian@gaslightmedia.com>
Fri, 19 Jan 2018 21:19:28 +0000 (16:19 -0500)
committerIan Weller <ian@gaslightmedia.com>
Fri, 19 Jan 2018 21:19:28 +0000 (16:19 -0500)
I just added the missing parts of the theme that was to be used for the
blog.  I still need to do some mass styling.

archive.php [new file with mode: 0644]
comments.php [new file with mode: 0644]
footer.php
front-page.php
parts/blog-sidebar-r.php [new file with mode: 0644]
scss/_structure.scss
single.php [new file with mode: 0644]

diff --git a/archive.php b/archive.php
new file mode 100644 (file)
index 0000000..de96ac4
--- /dev/null
@@ -0,0 +1,45 @@
+<?php get_header(); ?>
+<main class="blog-archive">
+    <div class="row">
+        <div id="blog-posts-over" class="small-12 medium-9 columns">
+            <?php if(have_posts()) : while(have_posts()): the_post();?>
+            <div class="row content blog-posts-container">
+              <!--  <div class="small-11 small-centered columns"> -->
+                <?php $thumbnail = get_the_post_thumbnail($post->ID, 'blog-feed-front'); ?>
+                <?php if ($thumbnail) { ?>
+                <div class="small-12 medium-4 columns text-center blog-feed-imgs">
+                    <?php echo $thumbnail; ?>
+                </div>
+                <div class="small-12 medium-8 columns blog-feed-contents">
+                    <?php } else { ?>
+                    <div class="small-12 columns blog-feed-content">
+                        <?php } ?>
+
+                        <article id="<?php the_ID()?>" <?php post_class()?>>
+          
+                        <header class="entry-header">
+                            <h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h1>
+                            <span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
+                        </header>
+                        <?php echo (function_exists('the_advanced_excerpt')) ? the_advanced_excerpt(): the_excerpt(); ?>
+                        <!--the_advanced_excerpt('length=200&length_type=words&no_custom=1&ellipsis=%26hellip;');-->
+                        <!-- This could be wrapped in php tags and be functional,
+                                but it is easier to change this in admin side-->
+                        
+                    </article>
+                </div>
+            </div>
+            <?php endwhile; ?>
+            <div class="navigation">
+                <span class="newer"><?php previous_posts_link(__('« Newer','example')) ?></span>
+                <span class="older"><?php next_posts_link(__('Older »','example')) ?></span>
+            </div><!-- /.navigation -->
+            <?php else: ?>
+            <div id="post-404" class="noposts">
+                <p><?php _e('Sorry, no results were found.');?></p>
+            </div><!-- /#post-404 -->
+            <?php endif;?>
+        </div>
+        <?php get_template_part('parts/blog-sidebar-r'); ?>
+    </div>
+    <?php get_footer(); ?>
diff --git a/comments.php b/comments.php
new file mode 100644 (file)
index 0000000..353cd14
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/**
+ * The template for displaying comments
+ *
+ * The area of the page that contains both current comments
+ * and the comment form.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Fifteen
+ * @since Twenty Fifteen 1.0
+ */
+if ( ! function_exists( 'twentyfifteen_comment_nav' ) ) :
+/**
+ * Display navigation to next/previous comments when applicable.
+ *
+ * @since Twenty Fifteen 1.0
+ */
+function twentyfifteen_comment_nav() {
+    // Are there comments to navigate through?
+    if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
+?>
+<nav class="navigation comment-navigation" role="navigation">
+    <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfifteen' ); ?></h2>
+    <div class="nav-links">
+        <?php
+    if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) :
+    printf( '<div class="nav-previous">%s</div>', $prev_link );
+    endif;
+
+    if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) :
+    printf( '<div class="nav-next">%s</div>', $next_link );
+    endif;
+        ?>
+    </div><!-- .nav-links -->
+</nav><!-- .comment-navigation -->
+<?php
+    endif;
+}
+endif;
+/*
+ * If the current post is protected by a password and
+ * the visitor has not yet entered the password we will
+ * return early without loading the comments.
+ */
+if ( post_password_required() ) {
+    return;
+}
+?>
+
+<div id="comments" class="comments-area">
+
+    <?php if ( have_comments() ) : ?>
+    <h2 class="comments-title">
+        <?php
+        printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentyfifteen' ),
+               number_format_i18n( get_comments_number() ), get_the_title() );
+        ?>
+    </h2>
+
+    <?php twentyfifteen_comment_nav(); ?>
+
+    <ol class="comment-list">
+        <?php
+        wp_list_comments( array(
+            'style'       => 'ol',
+            'short_ping'  => true,
+            'avatar_size' => 56,
+        ) );
+        ?>
+    </ol><!-- .comment-list -->
+
+    <?php twentyfifteen_comment_nav(); ?>
+
+    <?php endif; // have_comments() ?>
+
+    <?php
+    // If comments are closed and there are comments, let's leave a little note, shall we?
+    if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
+    ?>
+    <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p>
+    <?php endif; ?>
+
+    <?php comment_form(
+    array(
+        'class_submit' => 'button'
+    )
+); ?>
+
+</div><!-- .comments-area -->
index 2d919e4..889eac2 100755 (executable)
@@ -1,4 +1,4 @@
-            </div>
+
                 <footer class="small-10 small-centered columns">
                     <span>Charlevoix, Cheboygan, Emmet County Office of Emergency Management</span>
                     <span class="bullet"> &#8226; </span>
index 18611ed..1265033 100755 (executable)
@@ -55,4 +55,5 @@
                         </div>
                     </div>
                 </div>
+            </div>
 <?php get_footer(); ?>
diff --git a/parts/blog-sidebar-r.php b/parts/blog-sidebar-r.php
new file mode 100644 (file)
index 0000000..c051ab4
--- /dev/null
@@ -0,0 +1,33 @@
+        <div id="blog-side-info-wrapper" class="small-11 small-only-text-center medium-3 columns">
+            <div id="blog-side-info">
+                <form id="searchform" action="<?php echo esc_url( home_url() ); ?>" method="get">
+                    <div><input id="s" class="text" type="text" name="s" value="" />
+                    <input class="submit blogbutton" type="submit" name="submit" value="Search" />
+                    <input type="hidden" name="searchType" value="blog" /> </div>
+                </form>
+                <p>Recent Posts</p>
+                <ul>
+                <?php
+                        $args = array( 'numberposts' => '5','post_status'=>'publish' );
+                        $recent_posts = wp_get_recent_posts( $args );
+                        foreach( $recent_posts as $recent ){
+                                echo '<li><a href="' . get_permalink($recent["ID"]) . '">' .   $recent["post_title"].'</a> </li> ';
+                        }
+                ?>
+                </ul>
+                <p>Archive</p>
+                <ul><?php wp_get_archives( array( 'type' => 'monthly', 'limit' => 12 ) ); ?></ul>
+                <p>Categories</p>
+                <ul>
+                    <?php
+                    $args = array(
+                    'orderby' => 'name',
+                    'order' => 'ASC'
+                    );
+                  $categories = get_categories($args);
+                    foreach($categories as $category) {
+                      echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> ';  }
+                    ?>
+                </ul>
+            </div>
+        </div>
\ No newline at end of file
index 9f54981..78b3ccb 100644 (file)
@@ -979,4 +979,112 @@ img.alignleft, img.alignright, img.aligncenter, div.wp-caption img {
 a[href^=tel]{
     color:inherit;
     text-decoration:none;
+}
+
+.home-feed-post {
+    padding-bottom: 25px;
+    @media #{$small-only} {
+        > * {
+            text-align: center;
+        }
+    }
+}
+input[type="submit"].blogbutton {
+    border-radius: 3px;
+    color: $white;
+    border: 2px solid $white;
+    font-weight: bold;
+    font-size: 13px;
+    padding: 2px 5px;
+    margin-top: -10px;
+    text-transform: uppercase;
+    &:hover {
+        cursor: pointer;
+        background: $white;
+        border: 2px solid #035C84;
+        color:  white;
+    }
+}
+#blog-posts-over article {
+    padding-top: 10px;
+    margin-bottom: 15px;
+    display: inline-block;
+    width: 100%;
+    .entry-header {
+        background: transparent;
+    }
+    #addthis_wrapper {
+        margin-top: -25px;
+    }
+    p {
+        padding-bottom: 15px;
+    }
+    a.read-more {
+        border: 2px solid $white;
+        font-weight: bold;
+        font-size: 13px;
+        padding: 0 3px;
+        text-transform: uppercase;
+        &:hover {
+            background: $white;
+            border: 2px solid #035C84;
+            color: #035C84;
+        }
+    }
+     .entry-header {
+        margin-bottom: 10px;
+        .entry-title {
+            margin-bottom: 0;
+        }
+        .meta.date {
+            font-size: 13px;
+            font-weight: bold;
+        }
+    }
+}
+/*#searchform div input &[type="text"] {
+    width: 95%;
+}*/
+#blog-posts-over .entry-meta {
+    text-align: center;
+    color: #757575;
+    font-size: 12px;
+}
+#blog-posts-over > div {
+    margin: 25px 0;
+}
+#blog-side-info {
+    #searchform {
+        margin-bottom: 30px;
+    }
+    p {
+        margin-bottom: 0;
+    }
+}
+@media #{$small-only} {
+    #blog-side-info-wrapper {
+        float: none;
+        margin: 0 auto;
+        clear: both;
+    }
+    #blog-side-info {
+        padding-left: 0;
+        border-left: 0;
+        ul {
+            margin-left: 0;
+            margin-top:10px;
+        }
+        #searchform {
+            padding: 35px 0;
+            #s {
+                width: 100%;
+            }
+        }
+    }
+}
+#blog-side-info {
+    padding-right: 10px;
+    ul {
+        list-style-type: none;
+    }
 }
\ No newline at end of file
diff --git a/single.php b/single.php
new file mode 100644 (file)
index 0000000..544a472
--- /dev/null
@@ -0,0 +1,67 @@
+<?php get_header(); ?>
+<main class="blog-single small-10 small-centered columns">
+    <div class="row">
+        <div id="blog-posts-over" class="small-12 medium-9 columns">
+            <?php if(have_posts()) : while(have_posts()): the_post();?>
+            <div class="row blog-post-container">
+                <div class="small-11 small-centered columns">
+                    <div class="row">
+                        <div class="small-12 columns">
+                            <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>
+                                    <?php if ( has_post_thumbnail() ):?>
+                                             <?php if (get_post_type( $post ) != "ai1ec_event") { ?>
+                                    <div class="featured-image-wrap"><?php the_post_thumbnail("large"); ?></div>
+                                    <?php } ?>
+                                    <?php endif; ?>
+                                    <span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
+                                </header>
+                                <?php echo the_content(); ?>
+                            </article>
+                            <?php if ( comments_open() || get_comments_number() ) :
+                            comments_template();
+                            endif; ?>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <?php endwhile; ?>
+            <?php else: ?>
+            <div id="post-404" class="noposts">
+                <p><?php _e('Sorry, no results were found.');?></p>
+            </div><!-- /#post-404 -->
+            <?php endif;?>
+        </div>
+        <?php get_template_part('parts/blog-sidebar-r'); ?>
+    </div>
+</main>
+                <footer class="small-10 small-centered columns">
+                    <span>Charlevoix, Cheboygan, Emmet County Office of Emergency Management</span>
+                    <span class="bullet"> &#8226; </span>
+                    <span>P.O. Box 480, Petoskey, MI 49770 </span>
+                    <span class="bullet"> &#8226; </span>
+                    <span>855-515-1624</span>
+                </footer>
+            </div> <!-- 111 -->
+            <a class="exit-off-canvas"></a>
+            </div> <!-- 222 -->
+            <div class="row">
+                <div class="small-12 text-center columns sub-foot">
+                </div>
+                <div class="row">
+                    <div class="small-12 text-center columns" id="copyright">
+                        <span>Produced by <a href="http://www.gaslightmedia.com">Gaslight Media</a></span>
+                        <span class="bullet"> &#8226; </span>
+                        <span>Copyright &copy; <?php echo date('Y');?></span>
+                        <span class="bullet"> &#8226; </span>
+                        <span> All Rights Reserved</span>
+                    </div>
+                </div>
+            </div>
+            
+            </div> <!--inner-wrap-->
+        </div> <!--off-canvas-->
+    </body>
+    <?php wp_footer();?>
+</html>
\ No newline at end of file