f34ed9e0 by Jeff Balicki

news page

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent f3e2907c
...@@ -4,19 +4,60 @@ ...@@ -4,19 +4,60 @@
4 * 4 *
5 * @package Understrap 5 * @package Understrap
6 */ 6 */
7
8 // Exit if accessed directly. 7 // Exit if accessed directly.
9 defined( 'ABSPATH' ) || exit; 8 defined( 'ABSPATH' ) || exit;
10 9
11 get_header(); 10 get_header();
11
12 $container = get_theme_mod( 'understrap_container_type' ); 12 $container = get_theme_mod( 'understrap_container_type' );
13 13
14 if ( is_front_page() ) { 14 $post_thumbnail_id = get_post_thumbnail_id($post->ID);
15 get_template_part( 'global-templates/hero' ); 15 $thumbnail_image = get_posts(array('p' => $post_thumbnail_id, 'post_type' => 'attachment'));
16 $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID), 'full' );
17 $subhead = get_field('subhead');
18 //$badge = get_field('badge');
19
20 if ($thumbnail_image && isset($thumbnail_image[0])) {
21 $img_description = $thumbnail_image[0]->post_content;
22 $photo_caption = $thumbnail_image[0]->post_excerpt;
23 $img_alt = get_post_meta($post_thumbnail_id , '_wp_attachment_image_alt', true);
24 $img_title = $thumbnail_image[0]->post_title;
25 $copy = get_field('copy', $post_thumbnail_id );
16 } 26 }
17 27
18 ?>
19 28
29
30
31
32 ?>
33 <?php if ( has_post_thumbnail() ) { ?>
34 <header class="entry-header header page" style=" background-image: url('<?php echo $url;?> ')">
35 <div class="content-container">
36 <div class="container" style="height: 100%;">
37 <div class="col-md-12 fx-style">
38 <div class="search-box"><div id="search-box-content"><?php the_field('page_search_block', 'option'); ?></div> <div class="search-button">Search</div></div>
39 <div class="header_text">
40 <div class="breadcrumb"><?php get_breadcrumb(); ?></div>
41 <?php the_field('header_text'); ?>
42 </div>
43 <?php if($badge){
44 $badge_content = get_field('badge_content');
45 echo "<div class='badge'><span>".$badge_content['badge_label']."</span><div class='badge_content'><p>".$badge_content['badge_text']."</p></div></div>";
46 }?>
47 </div>
48
49 </div>
50 </div>
51 <div class='side-caption header-caption <?= (empty($copy) && empty($cap)) ? "hide" : "" ?>'>
52
53 <a class='copy-link' aria-label="Header Slide Caption" href='#' ></a>
54 <span class='image-side-caption'>
55 <span class='cap'><?= $photo_caption ?></span>
56 <span class='copyright'><?= ($copy) ? "&copy; ".$copy : "" ?></span>
57 </span>
58 </div>
59 </header><!-- .entry-header -->
60 <?php } ?>
20 <div class="wrapper" id="full-width-page-wrapper"> 61 <div class="wrapper" id="full-width-page-wrapper">
21 62
22 <div class="<?php echo esc_attr( $container ); ?>" id="content"> 63 <div class="<?php echo esc_attr( $container ); ?>" id="content">
...@@ -24,22 +65,24 @@ if ( is_front_page() ) { ...@@ -24,22 +65,24 @@ if ( is_front_page() ) {
24 <div class="col-md-12 content-area" id="primary"> 65 <div class="col-md-12 content-area" id="primary">
25 66
26 <main class="site-main" id="main" role="main"> 67 <main class="site-main" id="main" role="main">
68
69 <div class="header_text mobile"><div class="breadcrumb"><?php get_breadcrumb(); ?></div> <?php the_field('header_text'); ?> </div>
27 70
28 <?php 71 <?php
29 while ( have_posts() ) { 72 while ( have_posts() ) {
30 the_post(); 73 the_post();
31 get_template_part( 'loop-templates/content', 'single-story' ); 74
32 75 get_template_part( 'loop-templates/content', 'page' );
33 } 76 }
34 ?> 77 ?>
35 78
36 </main><!-- #main --> 79 </main><!-- #main -->
37 80
38 </div><!-- #primary --> 81 </div><!-- #primary -->
39 82
40 </div><!-- #content --> 83 </div><!-- #content -->
41 84
42 </div><!-- #full-width-page-wrapper --> 85 </div><!-- #full-width-page-wrapper -->
43 86
44 <?php 87 <?php
45 get_footer(); 88 get_footer();
......