function columns_content($column_name, $post_ID) { $agenda_detail = get_post_meta($post_ID, 'agenda_date', true); $date_time_format = 'l, j F Y (H:i)'; extract($agenda_detail); if ($column_name == 'agenda_start') { echo date_i18n($date_time_format, intval($mulai)) . ' ' . alfath_indo_timezone(); } if ($column_name == 'agenda_end') { echo date_i18n($date_time_format, intval($selesai)) . ' ' . alfath_indo_timezone(); } if ($column_name == 'agenda_location') { echo $lokasi; } }
function alfath_carousel_showthumb($params) { $id = rand(0, 999); // use a random ID so that the CSS IDs work with multiple on one page // Get current page/post title $current_pagetitle = get_the_title() !== '' && !is_front_page() ? get_the_title() : ''; // $post_object = get_post( $params['id'] ); // $params['content'] = $post_object->post_content; $images = array(); $slides_meta = get_post_meta($params['id'], 'alfath_slide', true); if (is_array($slides_meta) && !empty($slides_meta)) { foreach ($slides_meta as $slides) { $post_id = $slides['media']; $image = wp_get_attachment_image($slides['media'], 'slide-image2'); $content = $slides['textarea']; $thumb = wp_get_attachment_image($slides['media'], 'slide-thumbnail', false, array('class' => 'img-thumbnail')); $url = $slides['url']; $url_openblank = $slides['url_openblank']; $images[] = array('post_id' => $post_id, 'image' => $image, 'content' => $content, 'thumb' => $thumb, 'url' => esc_url($url), 'url_openblank' => $url_openblank == "1" ? true : false); } } if (count($images) > 0) { ob_start(); ?> <div class="alfath-carousel-wrap col-xs-12 no-padding"> <div id="alfath_<?php echo $id; ?> " class="carousel slide carousel-fade col-xs-12 no-padding" data-ride="carousel"> <div class="col-sm-5 col-xs-12 carousel-static-content bg-secondary"> <?php if ($current_pagetitle !== '') { ?> <h2><?php echo $current_pagetitle; ?> </h2> <?php } ?> <p><?php the_time('l, j F Y'); ?> | <?php the_time('G:i '); ?> <?php echo alfath_indo_timezone(); ?> </p> <?php echo $params['content']; ?> </div> <!-- Indicators --> <div class="carousel-indicator-wrap col-sm-7 no-padding"> <ul class="carousel-indicators"> <?php foreach ($images as $key => $image) { ?> <li data-target="#alfath_<?php echo $id; ?> " data-slide-to="<?php echo $key; ?> " data-interval="<?php echo $params['interval']; ?> " <?php echo $key == 0 ? 'class="active"' : ''; ?> ><?php echo $image['thumb']; ?> </li> <?php } ?> </ul> </div> <div class="carousel-inner"> <?php foreach ($images as $key => $image) { $linkstart = ''; $linkend = ''; if ($image['url']) { $linkstart = '<a href="' . $image['url'] . '"'; if ($image['url_openblank']) { $linkstart .= ' target="_blank"'; } $linkstart .= '>'; $linkend = '</a>'; } ?> <div class="item <?php echo $key == 0 ? 'active' : ''; ?> " id="<?php echo $image['post_id']; ?> "> <div class="col-sm-7 col-sm-offset-5 col-xs-8 col-xs-offset-4 no-padding"> <?php echo $linkstart . $image['image'] . $linkend; ?> </div> <!-- <div class="container"> --> <div class="carousel-caption col-sm-5 col-xs-4"> <!-- <h4><?php //echo $linkstart.$image['title'].$linkend; ?> </h4> --> <p><?php echo $linkstart . $image['content'] . $linkend; ?> </p> </div> </div> <?php } ?> </div> <div class="carousel-bottom-bg"></div> </div> </div> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#alfath_<?php echo $id; ?> ').carousel({ interval: <?php echo $params['interval']; ?> }); }); </script> <?php } $output = ob_get_contents(); ob_end_clean(); // Restore original Post Data wp_reset_postdata(); return $output; }
<?php breadcrumb_trail(array('separator' => '>', 'show_browse' => false, 'labels' => array('home' => '<i class="alf alf-home"></i>'))); ?> <time class="published" datetime="<?php echo get_the_time('c'); ?> "><?php echo get_the_date(); ?> | <?php echo get_the_time('G:i '); echo alfath_indo_timezone(); ?> </time>
/** * Show agenda details * @param int $post_id Post ID * @return string Html code for agenda details */ function alfath_agenda_detail($post_id = null) { $post = get_post(); if ($post_id == null) { $post_id = $post->ID; } $agenda_detail = get_post_meta($post_id, 'agenda_date', true); extract($agenda_detail); $output = ''; $date_format = get_option('date_format'); $date_time_format = 'l, j F Y H:i'; if (!empty($lokasi)) { $output .= '<i class="fa fa-map-marker"></i> ' . __('Lokasi: ') . $lokasi . '<br>'; } if (!empty($mulai) && date($date_format, intval($mulai)) === date($date_format, intval($selesai))) { $output .= '<i class="fa fa-calendar"></i> ' . date_i18n($date_time_format, intval($mulai)) . ' — ' . date_i18n('H:i', $selesai) . ' ' . alfath_indo_timezone() . '<br>'; } else { if (!empty($mulai)) { $output .= '<i class="fa fa-clock-o"></i> ' . __('Mulai: ') . date_i18n($date_time_format, intval($mulai)) . ' ' . alfath_indo_timezone() . '<br>'; } if (!empty($selesai)) { $output .= '<i class="fa fa-clock-o fa-rotate-180"></i> ' . __('Selesai: ') . date_i18n($date_time_format, intval($selesai)) . ' ' . alfath_indo_timezone(); } } return $output; }