-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-objects.php
52 lines (44 loc) · 1.6 KB
/
single-objects.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
get_header();
$object_data = get_fields(get_the_id());
if(have_posts()) : while(have_posts()) : the_post(); ?>
<main role="main" aria-label="Content">
<header class="object-header">
<?php
if($object_data['images']) :
// if(has_post_thumbnail()) :
// //if we have a post thumbnail, make sure it's part of the header
// $featured_image = array(
// 'image' => array(
// 'ID' => get_post_thumbnail_id(get_the_id())
// )
// );
// array_unshift($object_data['images'], $featured_image);
// endif;
echo '<div class="object-header-images displaying ' . (count($object_data['images']) == 1 ? 'text-center' : '') . '">';
foreach ($object_data['images'] as $key => $image) :
echo '<div class="image-cont">';
echo wp_get_attachment_image( $image['image']['ID'], 'large');
echo '</div>';
endforeach;
echo '</div>';
endif;
?>
<button class="scroll-right">Scroll<i class="fal fa-angle-right ms-3"></i></button>
</header>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="container">
<div class="row my-0">
<div class="col-12 my-0 spacer-item">
<div class="object-information">
<h1 class="object-title mt-4"><?php the_title(); ?></h1>
<?php echo siegal_object_info(get_the_id()); ?>
</div>
</div>
<?php the_content(); ?>
</div>
</div>
</article>
</main>
<?php endwhile; endif;
get_footer();