-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patharchive-work.php
More file actions
executable file
·69 lines (53 loc) · 2.2 KB
/
Copy patharchive-work.php
File metadata and controls
executable file
·69 lines (53 loc) · 2.2 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
$caseStudyIds = getPostMeta('work_archive_case_study_list_clients', $post->ID);
$sectorIds = getPostMeta('work_archive_sector_list_sector', $post->ID);
$srcQueryVar = get_query_var('src');
if ($srcQueryVar == "home-see-more") {
$home = get_page_by_title('Home');
$homeCaseStudies = getPostMeta('front_page_case_study_list_clients', $home->ID);
$caseStudyIds1 = array_diff($caseStudyIds, $homeCaseStudies);
$caseStudyIds2 = array_diff($homeCaseStudies, $caseStudyIds);
$removedDuplicateCaseStudyIds = array_merge($caseStudyIds1, $caseStudyIds2);
$caseStudyIds = $removedDuplicateCaseStudyIds;
}
if ($sectorIds) {
$linkList = '';
foreach ($sectorIds as $sectorId) {
$slug = get_post($sectorId)->post_name;
$linkList .= ('
<li>
<a class="c-tag" href="' . get_permalink($sectorId) . '">
<img src="' . get_template_directory_uri() . '/dist/svg/' . $slug . '.svg" alt="" width="36px" height="36px">
<span>' . get_the_title($sectorId) . '</span>
</a>
</li>
');
}
}
?>
<?php get_header(); ?>
<main>
<?php include(locate_template('src/template_parts/hero.php')) ?>
<?php if ($caseStudyIds) : ?>
<?php $globalCaseStudyIds = array_slice($caseStudyIds, 0, 2); // 1st 3 case studies ?>
<?php include(locate_template('src/template_parts/block_section_case_study_large.php')) ?>
<?php endif; ?>
<?php include(locate_template('src/template_parts/contact_us_banner.php')) ?>
<?php if ($caseStudyIds && count($caseStudyIds) > 2) : ?>
<?php $globalCaseStudyIds = array_slice($caseStudyIds, 2); // the remaining ?>
<?php include(locate_template('src/template_parts/block_section_case_study_small.php')) ?>
<?php endif; ?>
<section class="o-container-content o-container-content--v-margin">
<div class="c-work-footer" style="flex-direction: column">
<?php if (isset($linkList)) : ?>
<div class="c-work-footer__box" style="width: unset">
<h3 class="type-cta">See more…</h3>
<ul class="o-tag-list o-tag-list--lg">
<?= $linkList ?>
</ul>
</div>
<?php endif; ?>
</div>
</section>
</main>
<?php get_footer(); ?>