forked from Onemillionmonkeys/virt-eu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
infocard.php
33 lines (27 loc) · 1.11 KB
/
infocard.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
<?php
$postObject = get_post_type_object(get_post_type($item->ID));
if ($postObject) {
$postTypeTitle = esc_html($postObject->labels->singular_name);
//$posttype = esc_html($postObject->name);
}
echo '<div class="content-box content-box-roll content-box-width-2">';
if(get_field('use_header_as_thumbnail', $item->ID)) {
$thumbimage = get_field('header_image', $item->ID);
} else {
$thumbimage = get_field('thumbnail_image', $item->ID);
}
if($thumbimage) {
}
echo '<div class="info-card-thumb">';
echo '<a href="'.get_the_permalink($item->ID).'">'.wp_get_attachment_image($thumbimage['ID'], 'thumbnail').'</a>';
echo '</div>';
echo '<div class="info-card-details purple-text"><p>';
echo $postTypeTitle;
echo '</p></div>';
echo '<div class="info-card-title"><h3><a href="'.get_the_permalink($item->ID).'">'.get_the_title($item->ID).'</a></h3></div>';
if(get_field('excerpt', $item->ID)) {
echo '<p>'.get_field('excerpt', $item->ID).'</p>';
}
echo '<a class="link-btn purple-text" href="'.get_the_permalink($item->ID).'">'.get_field('read_more', 'options').'</a>';
echo '</div>';
?>