Browse Source

:blue_heart:

windhamdavid 3 years ago
parent
commit
4eb1bc611c
7 changed files with 133 additions and 76 deletions
  1. 0 1
      footer.php
  2. 24 58
      front-page.php
  3. 9 0
      functions.php
  4. 6 1
      header.php
  5. 39 2
      inc/theme.php
  6. 1 1
      search.php
  7. 54 13
      style.css

+ 0 - 1
footer.php

@@ -28,7 +28,6 @@
                   </div>
                 </div>
                 <button type="submit" class="btn btn-outline-light mt-2">Sign up</button>
-                <a href="newsletter" class="btn btn-outline-light  mt-2"><i class="bi bi-archive"></i> Archive</a>
               </form>
               <?php if ( is_active_sidebar( 'footer-3' )) :  dynamic_sidebar( 'footer-3' ); endif; ?>
             </div>

+ 24 - 58
front-page.php

@@ -1,75 +1,41 @@
 <?php get_header();?>
-
-<div id="content" class="site-content">
-  <div class="container">
+  <div class="container pt-5">
     <div class="row gx-5">
-
       <section id="primary" class="col-sm-12 col-lg-6">
         <div id="main" class="site-main" role="main">
           <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
             <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-            <div class="entry-content">
               <?php the_content(); ?>
-            </div>
-          </article>
-        <?php endwhile; ?>
+            </article>
+          <?php endwhile; ?>
         </div>
       </section>
-
-      <section id="secondary" class="col-sm-12 col-lg-6 ms-auto">
-          <?php $post = get_post(7); $output = apply_filters( 'the_content', $post->post_content ); echo $output; ?>
-          <h2 class="entry-title mt-5">Hospice Stores</h2>
-        <div class="row no-gutters">
-          <?php $upload_dir = wp_upload_dir(); ?>
-          <img src="<?php echo $upload_dir['baseurl']; ?>/2017/02/Hospice-Store-ribbon-cutting-2015-website-1-scaled.jpg">
-          <div class="col-sm-12 col-lg-6">
-            <h5><a href="">Greenwood</a></h5>
-            <p class="small">
-            864-229-9393<br />
-            217 North Creek Blvd<br />
-            Greenwood, SC 29649</p>
-          </div>
-          <div class="col-sm-12 col-lg-6">
-            <h5><a href="">Abbeville</a></h5>
-            <p class="small">
-            864-366-0237<br />
-            811 West Greenwood Street<br />
-            Abbeville, SC 29620</p>
-          </div>
-          <a href="" class="btn btn-outline-secondary">Learn More</a>
+      <section id="secondary" class="col-sm-12 col-lg-6 pt-2">
+        <div class="row">
+          <?php $post = get_page_by_title('B Front Page ( 2nd Column )'); $output = apply_filters( 'the_content', $post->post_content ); echo $output; ?>
         </div>
+      </section>
+    </div>
+    <div class="row gx-5 mt-4">
+      <hr/>
+      <header class="entry-header">
+        <h2><a href="<?php echo get_site_url();?>/news">News</a></h2>
+      </header>
+			<?php $mostrecentposts = new WP_Query();
+      $mostrecentposts = get_posts('numberposts=2');
+      foreach ($mostrecentposts as $post) : setup_postdata($post); ?>
+      <div class="col-sm-12 col-lg-6">
         <header class="entry-header">
-          <h2 class="entry-title mt-5">News</h2>
+          <h3 class="front-page m-0"><?php the_title( '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a>' );?></h3>
         </header>
-        <div class="">
-  				<?php $mostrecentposts = new WP_Query();
-          $mostrecentposts = get_posts('numberposts=1');
-          foreach ($mostrecentposts as $post) : setup_postdata($post); ?>
-          <div class="row">
-            <header class="entry-header">
-              <h3 class="front-page m-0"><?php the_title( '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a>' );?></h3>
-              <div class="entry-meta mt-0">
-                <time datetime="<?php echo get_the_date('c'); ?>" itemprop="datePublished"><i class="bi bi-calendar-date m2-1"></i> <?php echo get_the_date(); ?></time>
-              </div>
-            </header>
-            <div class="front-page-entry-content">
-              <div class="post-thumbnail">
-                <?php echo the_post_thumbnail(array(180,180), ['class' => 'p-2 float-end']); ?>
-              </div>
-              <?php the_excerpt();?>
-            </div>
+        <div class="front-page-entry-content">
+          <div class="post-thumbnail">
+            <?php echo the_post_thumbnail(array(180,180), ['class' => 'p-2 float-end']); ?>
           </div>
-  				<?php endforeach;wp_reset_query();?>
-        </div>
-        <div class="">
-  				<?php $recentposts = get_posts(array('numberposts'=>5,'offset'=>1)); foreach ($recentposts as $post) : setup_postdata($post); ?>
-  				       <li style="color:#777;list-style:none;"><?php echo get_the_date('m/d/y'); ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
-  				<?php endforeach; ?>
+          <?php the_excerpt();?>
         </div>
-      </section>
-
+      </div>
+			<?php endforeach;wp_reset_query();?>
     </div>
   </div>
-</div>
-
 <?php get_footer();?>

+ 9 - 0
functions.php

@@ -50,6 +50,15 @@ add_action( 'after_setup_theme', 'boot23_setup' );
 *************************************/
 
 function boot23_widgets_init() {
+  register_sidebar( array(
+      'name'          => esc_html__( 'Homepage', 'hp-theme' ),
+      'id'            => 'homepage-widget',
+      'description'   => esc_html__( 'Add widgets here.', 'hp-theme' ),
+      'before_widget' => '<section id="%1$s" class="widget %2$s">',
+      'after_widget'  => '</section>',
+      'before_title'  => '<h3 class="widget-title">',
+      'after_title'   => '</h3>',
+  ) );
     register_sidebar( array(
         'name'          => esc_html__( 'Sidebar', 'hp-theme' ),
         'id'            => 'sidebar-1',

+ 6 - 1
header.php

@@ -33,7 +33,12 @@
         <span class="navbar-toggler-icon"></span>
       </button>
       <div class="navbar-brand mx-auto">
-        <a class="site-title" href="<?php echo esc_url( home_url( '/' )); ?>">Hospice &amp; Palliative <span><img src="<?php echo get_template_directory_uri(); ?>/img/dove-white.png"/></span> Care &nbsp;<small>of the Peidmont</small></a>
+      <a class="site-title" href="<?php echo esc_url( home_url( '/' )); ?>">
+        <span class="logo-firstline">Hospice &amp;</span>
+        <span class="logo-img"><img src="<?php echo get_template_directory_uri(); ?>/img/dove-white.png"/></span>
+        <span class="logo-secondline">Palliative Care</span>
+        <span class="logo-byline">of the Peidmont</span>
+      </a>
       </div>
       <?php wp_nav_menu(array(
         'theme_location'  => 'primary',

+ 39 - 2
inc/theme.php

@@ -4,8 +4,6 @@
 // ######### cleanup migration  ################ //
 **************************************************/
 
-// define('TRIBE_DISABLE_TOOLBAR_ITEMS', true);
-
 add_action('set_current_user', 'hp_hide_admin_bar');
 function hp_hide_admin_bar() {
   show_admin_bar(false);
@@ -80,6 +78,45 @@ function hp_theme_setup() {
 add_action( 'after_setup_theme', 'hp_theme_setup' );
 
 
+/*******************************************
+// ######### Recent News Widget ######### //
+*******************************************/
+
+class HP_News_Widget extends WP_Widget {
+  public function __construct() {
+    $options = array(
+      'classname' => 'news-widget',
+      'description' => 'News Widget',
+      'customize_selective_refresh' => true,
+    );
+    parent::__construct(
+      'news-widget', 'News Widget', $options
+    );
+  }
+  public function widget( $args, $instance ) {
+    $q_args = array(
+      'post_type' => 'post',
+      'posts_per_page' => '2'
+    );
+    $query = new WP_Query( $q_args );
+      while ($query->have_posts()) {
+      $query->the_post();
+      echo $args['before_widget'];
+      echo $args['before_title'] . apply_filters( 'widget_title', 'News' ) . $args['after_title'];
+      the_title();
+      echo get_the_excerpt();
+      echo $args['after_widget'];
+    }
+    wp_reset_postdata();
+  }
+}
+
+function hp_register_news_widget() {
+    register_widget( 'HP_News_Widget' );
+}
+add_action( 'widgets_init', 'hp_register_news_widget' );
+
+
 /*******************************************
 // ######### Donation Menu Item ######### //
 *******************************************/

+ 1 - 1
search.php

@@ -1,6 +1,6 @@
 <?php get_header();?>
   <div class="container">
-    <div class="row">
+    <div class="row py-5">
       <div class="col-lg-9 col-sm-12">
         <?php if ( have_posts() ) : ?>
   				<header class="page-header">

+ 54 - 13
style.css

@@ -70,14 +70,25 @@ h2.entry-title {
   font-family: 'Lato', sans-serif;
   border-bottom: 1px solid #eaecef;
 }
-h3.front-page {
-
+.home h2.lato {
+  font-family: 'Lato', Helvetica, Arial, sans-serif;
+  margin-bottom:0px;
+  font-weight:400;
+}
+.home h3.lato {
+  font-family: 'Lato', Helvetica, Arial, sans-serif;
+  font-weight:300;
 }
 ul.page-history {
   list-style:none;
   padding: 0 0 0 5px;
 }
-
+.lato {
+  font-family: 'Lato', Helvetica, Arial, sans-serif;
+}
+.has-purple-color {
+  color:#343C70;
+}
 
 /*--------------------------------------------------------------
 ########################## Elements ##########################
@@ -116,8 +127,9 @@ table {
     font-size:15px;
   }
 }
+
 #masthead {
-  padding: 12px 0;
+  padding: 5px 0;
   background-color:#325363;
   border-top: 3px solid #343C70;
 }
@@ -132,7 +144,7 @@ table {
 .navbar-brand > a {
   font-family: 'Lato', sans-serif;
   color: rgba(0, 0, 0, 0.9);
-  font-size: 21px;
+  font-size: 23px;
   outline: medium none;
   text-decoration: none;
   color: #d7d7d7;
@@ -145,29 +157,59 @@ table {
   text-decoration: none;
   color:#7ac9f0;
 }
-@media (max-width: 767px) {
+
+.logo-firstline {
+  font-variant:small-caps;
+}
+.logo-img img {
+  margin-top:-18px;
+}
+.logo-secondline {
+  font-variant:small-caps;
+  display:block;
+  margin: -13px 0 0;
+}
+.logo-byline {
+  display:block;
+  margin:-8px 0 0;
+  padding-left:44px;
+  font-size:14px;
+}
+@media (min-width: 768px) and (max-width: 992px) {
   .navbar-brand > a {
-    font-size: 15px;
+    font-size: 19px;
   }
   .navbar-brand img {
-    width: 25px;
+    width: 30px;
   }
   .navbar-toggler {
     padding:4px;
     font-size:12px;
   }
+  .logo-byline {
+    display:block;
+    margin:-8px 0 0;
+    padding-left:30px;
+    font-size:12px;
+  }
 }
-@media (min-width: 768px) and (max-width: 992px) {
+@media (max-width: 767px) {
   .navbar-brand > a {
-    font-size: 19px;
+    font-size: 15px;
   }
   .navbar-brand img {
-    width: 30px;
+    width: 25px;
   }
   .navbar-toggler {
     padding:4px;
     font-size:12px;
   }
+  .logo-byline {
+    display:block;
+    margin:-8px 0 0;
+    padding-left:26px;
+    font-size:10px;
+  }
 }
 .dropdown-item.active, .dropdown-item:active {
   color:#777;
@@ -782,8 +824,7 @@ h3.lato-widget {
   color:#d7d7d7;
 }
 h3.widget-title {
-  margin-bottom: 16px;
-  padding-bottom: 16px;
+  margin-bottom: 12px;
   border-bottom: .25px solid rgba(255, 255, 255, .25);
 }
 .half-rule {