-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathausflug.php
More file actions
40 lines (37 loc) · 1.45 KB
/
ausflug.php
File metadata and controls
40 lines (37 loc) · 1.45 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
<?php
/**
* template for a single ausflug
*
* @package gemeindetage-ausfluege
*/
$start_date = get_post_meta( get_the_ID(), 'startZeit', true );
$end_date = get_post_meta( get_the_ID(), 'endZeit', true );
$leiter = get_post_meta( get_the_ID(), 'leiter', true );
$beschreibung = get_post_meta( get_the_ID(), 'beschreibung', true );
$character = get_post_meta( get_the_ID(), 'character', true );
$nr = get_post_meta( get_the_ID(), 'nr', true );
$preis = get_post_meta( get_the_ID(), 'preis', true );
$registration_closed = get_post_meta( get_the_ID(), 'registrationClosed', true );
$start = new \DateTime( $start_date );
$end = new \DateTime( $end_date );
?>
<div class="ausflug" id="<?php echo esc_attr( "$character$nr" ); ?>">
<?php the_post_thumbnail(); ?>
<span class="ausflug-nummer">
<p><?php echo esc_attr( "$character$nr" ); ?></p>
</span>
<?php if ( $registration_closed ) { ?>
<p class="registration-closed">Ausgebucht!</p>
<?php } ?>
<div class="ausflug-content">
<h2><?php the_title(); ?></h2>
<div class="description"><?php the_content(); ?>
<footer class="ausflug-footer">
<span class="zeit"><?php echo esc_attr( $start->format( 'H:i' ) ); ?><?php echo esc_attr( ' - ' . $end->format( 'H:i' ) ); ?></span>
<?php if ( $preis ) { ?>
<span class="preis"><?php echo esc_attr( "$preis €" ); ?></span>
<?php } ?>
</footer>
</div>
</div>
</div>