-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-mission-trip.php
68 lines (53 loc) · 2.16 KB
/
archive-mission-trip.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* Mission trip archive.
*
* @package Dkjensen\JesusFilmProject
* @link https://dkjensen.com
* @author David Jensen
* @copyright Copyright © 2021 David Jensen
* @license GPL-3.0
*/
namespace Dkjensen\JesusFilmProject;
\add_action( 'genesis_hero_section', __NAMESPACE__ . '\archive_mission_trip_hero_prefix', 8 );
/**
* Before hero title
*
* @return void
*/
function archive_mission_trip_hero_prefix() {
printf( '<h5><a href="%s">%s /</a></h5>', \esc_url( \get_permalink( \get_page_by_path( '/partners/mission-trips/' ) ) ), esc_html__( 'GO', 'jesus-film-project' ) );
}
\add_action( 'genesis_before_footer', __NAMESPACE__ . '\archive_mission_trip_footer' );
function archive_mission_trip_footer() {
$background_image = \wp_get_attachment_image_url( \get_term_meta( \get_queried_object_id(), 'background_image', true ) ?: 0, 'full' );
$copy = \get_term_meta( \get_queried_object_id(), 'copy', true ) ?: esc_html__( 'We offer trips from remote villages to urban settings, church planting to university ministry. Opportunities include open and discreet evangelism, one-to-one, small-group and large-group film showings, and you\'ll be trained on Jesus Film Project app tools.', 'jesus-film-project' );
$form = \get_term_meta( \get_queried_object_id(), 'form', true );
ob_start();
?>
<?php
if ( $background_image ) {
printf( '<style>.mission-trip-archive-footer { background-image: url("%s"); }</style>', \esc_url( $background_image ) );
}
?>
<div class="mission-trip-archive-footer__content">
<div class="one-half first">
<h3 class="has-text-color has-white-color"><?php \single_term_title( esc_html__( 'About', 'jesus-film-project' ) . ' ' ); ?></h3>
<div><?php echo apply_filters( 'comment_text', $copy ); ?></div>
</div>
<div class="one-third">
<?php echo ( $form ) ? \do_shortcode( '[gravityform id=' . (int) $form . ' title="false" description="true" ajax="true"]' ) : ''; ?>
</div>
</div>
<?php
$content = ob_get_clean();
\genesis_markup(
array(
'open' => '<div %s><div class="wrap">',
'close' => '</div></div>',
'content' => $content,
'context' => 'mission-trip-archive-footer',
)
);
}
\genesis();