content-page.php
2.15 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
70
71
72
73
74
75
76
77
78
<?php
/**
* Partial template for content in page.php
*
* @package Understrap
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
$slides = [];
$featured_image = null;
if(function_exists( 'get_field')) {
$slides = get_field('header_slides', get_the_ID());
$featured_image = get_the_post_thumbnail_url( get_the_ID(), 'large' );
if(!$featured_image) {
$featured_image = get_field('photo_from_source', get_the_ID());
}
}
?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php
if (empty($slides) && (!$featured_image || is_page_template("page-templates/h1belowphoto.php") || has_term('job-profile','page_type') || has_term('job-profile-fr','page_type') || is_page_template("page-templates/campaign-landing.php") ) ) {?>
<header class="entry-header home <?= (!has_term('job-profile','page_type'))?'no-photo':'' ?>">
<?php } else { ?>
<header class="entry-header home">
<?php } ?>
<?php
get_template_part("template-parts/header");
?>
</header><!-- .entry-header -->
<?php if(is_front_page()) { ?>
<div class='content-header-seperater'></div>
<?php } ?>
<div class="entry-content <?= (has_term('job-profile','page_type'))?'job-profile':'' ?>">
<?php
if (empty($slides) && (!$featured_image || is_page_template("page-templates/h1belowphoto.php") || has_term('job-profile','page_type') || has_term('job-profile-fr','page_type') || is_page_template("page-templates/campaign-landing.php") ) ) { ?>
<div class='no-header-photo'>
<div class="breadcrumb"><?php get_breadcrumb(); ?></div>
<?php the_title( '<h1 class="entry-title">', '</h1>' );
$h2 = get_post_meta($post->ID, 'subhead', true);
if(!empty($h2)) {
?>
<h2 class="subhead"><?= $h2 ?></h2>
<?php } ?>
</div>
<?php }
?>
<?php if(has_term('urgent-job','page_type',get_the_ID()) || has_term('urgent-job-fr','page_type',get_the_ID()) ) { ?>
<span class='urgent-header'><?= __('URGENT', 'msf') ?></span>
<?php } ?>
<?php
the_content();
understrap_link_pages();
?>
</div><!-- .entry-content -->
<footer class="entry-footer">
<?php understrap_edit_post_link(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->