Advertisement
bananamariap

Somersworth page-home.php

Sep 28th, 2021
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.21 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying all pages.
  4. *
  5. * This is the template that displays all pages by default.
  6. * Please note that this is the WordPress construct of pages
  7. * and that other 'pages' on your WordPress site may use a
  8. * different template.
  9. *
  10. * @link https://codex.wordpress.org/Template_Hierarchy
  11. *
  12. * @package sws
  13. */
  14.  
  15. get_header(); ?>
  16.  
  17. <div id="primary" class="content-area ">
  18. <main id="main" class="site-main" role="main">
  19.  
  20. <!-- Show Title -->
  21. <?php while ( have_posts() ) : the_post(); ?>
  22. <header class="entry-header">
  23. <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
  24. </header><!-- .entry-header -->
  25. <?php endwhile; ?>
  26. <!-- End Show Title -->
  27.  
  28. <!-- Featured Units -->
  29. <?php
  30. $args = array(
  31. 'post_type' => 'product',
  32. 'meta_key' => '_featured',
  33. 'meta_value' => 'yes',
  34. 'posts_per_page' => 4
  35. );
  36.  
  37. $featured_query = new WP_Query( $args ); ?>
  38.  
  39. <div class="section box-featured-units group">
  40. <h1 class="section-title"><?php _e( 'Featured Units' , THEMELANG ) ?></h1>
  41. <?php if ($featured_query->have_posts()) : ?>
  42.  
  43. <div class="featured-products col">
  44.  
  45. <?php while ($featured_query->have_posts()) : $featured_query->the_post();
  46. $product = wc_get_product( $featured_query->post->ID );
  47. ?>
  48.  
  49.  
  50. <div class="product">
  51. <div class="wrap">
  52. <h1 class="product-title"><?php the_title(); ?></h1><hr>
  53. <h2 class="product-price"><span>From <?php echo get_woocommerce_currency_symbol(); ?></span><?php echo $product->get_price(); ?></h2>
  54. <?php echo do_shortcode('[button url="./reserve-now" class="btn-primary btn-sm" target="self"]Reserve Now[/button]'); ?>
  55. </div>
  56. </div>
  57.  
  58. <?php endwhile; ?>
  59.  
  60. </div>
  61.  
  62. <?php endif; wp_reset_query(); ?>
  63.  
  64. <div class="sws-links col climate-control">
  65. <a href="#"><?php _e( 'Climate Control Units' , THEMELANG ); ?></a>
  66. <?php echo do_shortcode('[button url="./basic-storage" class="btn-primary btn-sm"]LEARN MORE![/button]'); ?>
  67. </div>
  68.  
  69. <!-- Syrasoft Links -->
  70. <div class="sws-links col syrasoft">
  71. <ul class="sim-links-list">
  72. <li>
  73. <a href="./all-units">
  74. <?php _e( 'All Units',THEMELANG ); ?>
  75.  
  76. </a>
  77. </li>
  78. <li>
  79. <a href="./space-calculator">
  80. <?php _e( 'Storage Calculators',THEMELANG ); ?>
  81. </a>
  82. </li>
  83. </ul>
  84. </div>
  85.  
  86. </div>
  87.  
  88.  
  89.  
  90.  
  91.  
  92. <!-- Entry Content -->
  93. <div class="col span_2_of_2 section-entry-content">
  94. <?php while ( have_posts() ) : the_post(); ?>
  95. <div class="entry-content">
  96. <?php the_content(); ?>
  97. </div><!-- .entry-content -->
  98. <?php endwhile; ?>
  99. </div>
  100.  
  101. <!-- Contact Us Details /Map -->
  102. <div class="col span_2_of_2 section-contact-us group">
  103. <?php
  104.  
  105. /**
  106. * Get Metaboxes input details
  107. */
  108.  
  109. $contact_page_id = 18;
  110.  
  111. $telno = rwmb_meta( '{$prefix}telno' , 'type=text', $contact_page_id );
  112. $email = rwmb_meta( '{$prefix}email' , 'type=email', $contact_page_id );
  113. $address = rwmb_meta( '{$prefix}address' , 'type=text', $contact_page_id );
  114. $notes = rwmb_meta( '{$prefix}other_notes' , 'type=textarea', $contact_page_id );
  115. $hours = get_post_meta( $contact_page_id, '{$prefix}office_hours' , true );
  116.  
  117. $args = array(
  118. 'type' => 'map',
  119. 'width' => '100%',
  120. 'height' => '500px',
  121. 'zoom' => 10,
  122. 'marker' => true, // Display marker? Default is 'true',
  123. 'marker_title' => '', // Marker title when hover
  124. 'info_window' => '<div class="info-window"><h1>' . get_bloginfo('title') . '</h1><p class="address">' . $address . '</p> <p class="link-direction"><a href="https://www.google.com/maps/place/240+NH-108,+Somersworth,+NH+03878/@43.2479827,-70.9007997,18z/data=!4m20!1m14!4m13!1m4!2m2!1d14.4222689!2d50.0860381!4e1!1m6!1m2!1s0x89e2998cae6e15d9:0x38ed09c2da078f7f!2s240+Route+108,+Somersworth,+NH!2m2!1d-70.9008387!2d43.2486556!3e0!3m4!1s0x89e2998cae6e15d9:0x38ed09c2da078f7f!8m2!3d43.2486556!4d-70.9008387" target="_blank">Directions</a></p></div>', // Info window content, can be anything. HTML allowed.
  125. );
  126.  
  127. $map = rwmb_meta( '_sws_map', $args, $contact_page_id );
  128. ?>
  129. <div class="section group">
  130. <div class="col span_1_of_2 text">
  131. <ul class="contact-list">
  132. <li>
  133. <div class="wrap">
  134. <h1 class="section-title"><?php _e( 'Contact Us' , THEMELANG ); ?></h1>
  135. <p class="address"><span><?php _e( 'Address:' , THEMELANG ); ?></span><br><?php echo $address; ?></p>
  136.  
  137. <?php echo do_shortcode('[button id="email-us-now" url="./contact" class="btn-white"]Email us now[/button]'); ?>
  138.  
  139. <p class="telephone"><span><?php _e( 'Telephone:' , THEMELANG ); ?></span><br><?php echo $telno; ?></p>
  140. </div>
  141. </li>
  142. <li>
  143. <div class="wrap">
  144. <h1 class="section-title"><?php _e( 'Hours' , THEMELANG ); ?></h1>
  145. <div class="wrap-date-time">
  146. <?php foreach ($hours as $hour) : ?>
  147. <div class="date-time">
  148. <span class="section-label"><?php echo $hour['{$prefix}day']; ?></span>
  149. <span><?php echo $hour['{$prefix}time']; ?></span>
  150. </div>
  151. <?php endforeach; ?>
  152. </div>
  153. <p class="other-notes"><?php echo $notes; ?></p>
  154. </div>
  155. </li>
  156. </ul>
  157. </div>
  158. <div class="col span_1_of_2 wrapper-map">
  159. <?php echo $map; ?>
  160. </div>
  161.  
  162. </div>
  163. </div>
  164.  
  165. <!-- End Contact Us Details /Map -->
  166.  
  167. <!-- Blog / Reviews -->
  168.  
  169. <div class="section section-blog-review group">
  170. <div class="col span_1_of_2 wrap-blog">
  171. <?php echo do_shortcode('[show_recent_blog]'); ?>
  172.  
  173. </div>
  174. <div class="col span_1_of_2 wrap-review">
  175. <?php echo do_shortcode('[display-frm-data id=recent-reviews filter=1]'); ?>
  176. </div>
  177. </div>
  178.  
  179. </div>
  180.  
  181.  
  182. </main><!-- #main -->
  183. </div><!-- #primary -->
  184.  
  185. <?php get_footer(); ?>
  186.  
  187.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement