function siw_cpt_breadcrumbs() { $delimiter = '/'; if (is_singular('vacatures')) { $vacature_parent = siw_get_parent_page('vacatures'); if (!empty($vacature_parent)) { $parentpagelink = get_page_link($vacature_parent); $parenttitle = get_the_title($vacature_parent); echo '<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="' . $parentpagelink . '"><span itemprop="title">' . $parenttitle . '</span></a></span> ' . $delimiter . ' '; } } if (is_singular('agenda')) { $agenda_parent = siw_get_parent_page('agenda'); if (!empty($agenda_parent)) { $parentpagelink = get_page_link($agenda_parent); $parenttitle = get_the_title($agenda_parent); echo '<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="' . $parentpagelink . '"><span itemprop="title">' . $parenttitle . '</span></a></span> ' . $delimiter . ' '; } } }
public function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $agenda_page = siw_get_parent_page('agenda'); $meta_quer_args = array('relation' => 'AND', array('key' => 'siw_agenda_eind', 'value' => time(), 'compare' => '>=')); $query_args = array('post_type' => 'agenda', 'posts_per_page' => 1, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'meta_key' => 'siw_agenda_start', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'meta_query' => $meta_quer_args); $siw_agenda = new WP_Query($query_args); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <?php if ($siw_agenda->have_posts()) { ?> <ul class="siw_events"> <?php while ($siw_agenda->have_posts()) { $siw_agenda->the_post(); $start_ts = get_post_meta(get_the_ID(), 'siw_agenda_start', true); $end_ts = get_post_meta(get_the_ID(), 'siw_agenda_eind', true); $date_range = siw_get_date_range_in_text(date("Y-m-d", $start_ts), date("Y-m-d", $end_ts), false); $location = get_post_meta(get_the_ID(), 'siw_agenda_locatie', true); $address = get_post_meta(get_the_ID(), 'siw_agenda_adres', true); $postal_code = get_post_meta(get_the_ID(), 'siw_agenda_postcode', true); $city = get_post_meta(get_the_ID(), 'siw_agenda_plaats', true); $start_time = date("H:i", $start_ts); $end_time = date("H:i", $end_ts); ?> <li class="siw_event"> <h5 class="siw_event_title"> <a href="<?php esc_url(the_permalink()); ?> " class="siw_event_link"><?php esc_html(the_title()); ?> </a> </h5> <span class="siw_event_duration" > <?php echo esc_html($date_range); ?> <br/> <?php echo esc_html($start_time . ' - ' . $end_time); ?> <br/> </span> <span class="siw_event_location"><?php echo esc_html($location . ', ' . $city); ?> </span> <script type="application/ld+json"> [{ "@context" : "http://schema.org", "name" : "<?php esc_attr(the_title()); ?> ", "@type" : "event", "startDate" : "<?php echo esc_attr(date('Y-m-d', $start_ts)); ?> ", "endDate" : "<?php echo esc_attr(date('Y-m-d', $end_ts)); ?> ", "location" : { "@type" : "Place", "name" : "<?php echo esc_attr($location); ?> ", "address" : "<?php echo esc_attr($address . ', ' . $postal_code . ' ' . $city); ?> " }, "url": "<?php echo esc_url(the_permalink()); ?> " }] </script> </li> <?php } ?> </ul> <p class="siw_agenda_page_link"> <a href="<?php echo esc_url(get_page_link($agenda_page)); ?> "><?php _e('Bekijk de volledige agenda.', 'siw'); ?> </a> </p> <?php } else { ?> <p><?php _e('Er zijn momenteel geen geplande activiteiten.', 'siw'); ?> </p> <?php } wp_reset_query(); echo $after_widget; }
$program = get_post_meta($id, 'siw_agenda_programma', true); $description = get_post_meta($id, 'siw_agenda_beschrijving', true); $location = get_post_meta($id, 'siw_agenda_locatie', true); $address = get_post_meta($id, 'siw_agenda_adres', true); $postal_code = get_post_meta($id, 'siw_agenda_postcode', true); $city = get_post_meta($id, 'siw_agenda_plaats', true); $vfb_form_id = siw_get_vfb_form_id('community_day'); $application = get_post_meta($id, 'siw_agenda_aanmelden', true); $application_explanation = get_post_meta($id, 'siw_agenda_aanmelden_toelichting', true); $application_link_url = get_post_meta($id, 'siw_agenda_aanmelden_link_url', true); $application_link_text = get_post_meta($id, 'siw_agenda_aanmelden_link_tekst', true); $location_map = '[gmap address="' . $address . ', ' . $postal_code . ' ' . $city . '" title="' . $location . '" zoom="15" maptype="ROADMAP"]'; $hide_form_days_before_cd = siw_get_hide_form_days_before_cd(); $limit_date = date("Y-m-d", strtotime(date("Y-m-d") . "+" . $hide_form_days_before_cd . " days")); $text_after_hide_cd_form = siw_get_text_after_hide_cd_form(); $agenda_page_url = get_permalink(siw_get_parent_page('agenda')); ?> <div id="content" class="container"> <div class="row single-article"> <div class="main col-md-12 kt-nosidebar" role="main"> <?php while (have_posts()) { the_post(); ?> <article <?php post_class(); ?> id="agenda-<?php the_ID(); ?>