function eventorganiser_event_fill_columns($column_name, $id)
{
    global $post;
    $series_id = empty($post->event_id) ? $id : '';
    $phpFormat = 'M, jS Y';
    if (!eo_is_all_day($series_id)) {
        $phpFormat .= '\\<\\/\\b\\r\\>' . get_option('time_format');
    }
    switch ($column_name) {
        case 'venue':
            $terms = get_the_terms($post->ID, 'event-venue');
            if (!empty($terms)) {
                foreach ($terms as $term) {
                    $post_terms[] = "<a href='" . add_query_arg('event-venue', $term->slug) . "'>" . esc_html(sanitize_term_field('name', $term->name, $term->term_id, 'event-venue', 'display')) . "</a>";
                }
                echo join(', ', $post_terms);
                echo "<input type='hidden' value='" . $term->term_id . "'/>";
            }
            break;
        case 'datestart':
            eo_the_start($phpFormat, $series_id);
            break;
        case 'dateend':
            eo_the_end($phpFormat, $series_id);
            break;
        case 'reoccurence':
            eo_display_reoccurence($series_id);
            break;
        case 'eventcategories':
            $terms = get_the_terms($post->ID, 'event-category');
            if (!empty($terms)) {
                foreach ($terms as $term) {
                    $post_terms[] = "<a href='" . add_query_arg('event-category', $term->slug) . "'>" . esc_html(sanitize_term_field('name', $term->name, $term->term_id, 'event-category', 'display')) . "</a>";
                }
                echo join(', ', $post_terms);
            }
            break;
        default:
            break;
    }
    // end switch
}
Esempio n. 2
0
function eventorganiser_event_fill_columns($column_name, $id)
{
    global $post;
    $series_id = empty($post->event_id) ? $id : '';
    $phpFormat = 'M, j Y';
    if (!eo_is_all_day($series_id)) {
        $phpFormat .= '\\<\\/\\b\\r\\>' . get_option('time_format');
    }
    switch ($column_name) {
        case 'venue':
            $venue_id = eo_get_venue($post->ID);
            $venue_slug = eo_get_venue_slug($post->ID);
            if ($venue_id) {
                echo '<a href="' . esc_url(add_query_arg('event-venue', $venue_slug)) . '">' . esc_html(eo_get_venue_name($venue_id)) . '</a>';
                echo '<input type="hidden" value="' . $venue_id . '"/>';
            }
            break;
        case 'datestart':
            eo_the_start($phpFormat, $series_id);
            break;
        case 'dateend':
            eo_the_end($phpFormat, $series_id);
            break;
        case 'reoccurence':
            eo_display_reoccurence($series_id);
            break;
        case 'eventcategories':
            $terms = get_the_terms($post->ID, 'event-category');
            if (!empty($terms)) {
                $post_terms = array();
                foreach ($terms as $term) {
                    $post_terms[] = '<a href="' . esc_url(add_query_arg('event-category', $term->slug)) . '">' . esc_html(sanitize_term_field('name', $term->name, $term->term_id, 'event-category', 'display')) . '</a>';
                }
                echo join(', ', $post_terms);
            }
            break;
    }
    // end switch
}
    //Event reoccurs - display dates.
    $upcoming = new WP_Query(array('post_type' => 'event', 'event_start_after' => 'today', 'posts_per_page' => -1, 'event_series' => get_the_ID(), 'group_events_by' => 'occurrence'));
    if ($upcoming->have_posts()) {
        ?>

					<li><strong><?php 
        _e('Upcoming Dates', 'eventorganiser');
        ?>
:</strong>
						<ul id="eo-upcoming-dates">
							<?php 
        while ($upcoming->have_posts()) {
            $upcoming->the_post();
            ?>
									<li> <?php 
            eo_the_start($date_format);
            ?>
</li>
							<?php 
        }
        ?>
						</ul>
					</li>
 
					<?php 
        wp_reset_postdata();
        //With the ID 'eo-upcoming-dates', JS will hide all but the next 5 dates, with options to show more.
        wp_enqueue_script('eo_front');
        ?>
				<?php 
    }
          <?php 
        //Format date/time according to whether its an all day event.
        //Use microdata https://support.google.com/webmasters/bin/answer.py?hl=en&answer=176035
        if (eo_is_all_day()) {
            $format = 'd F Y';
            $microformat = 'Y-m-d';
        } else {
            $format = 'd F Y ' . get_option('time_format');
            $microformat = 'c';
        }
        ?>
          <time itemprop="startDate" datetime="<?php 
        eo_the_start($microformat);
        ?>
"><?php 
        eo_the_start($format);
        ?>
</time></div>
        <div class="table-col table-region"><?php 
        the_field('region');
        ?>
</div>
      </li>
      <?php 
    }
    ?>
    </ul>
  
    <?php 
} else {
    ?>
          <div class="table-col table-genre"><?php 
        the_field('musikgenre');
        the_field('theatergenre');
        ?>
</div>
          <div class="table-col table-datum">
            <time class="date" itemprop="startDate" datetime="<?php 
        eo_the_start($microformat);
        ?>
"><?php 
        if (is_user_logged_in()) {
            eo_the_start('D d.m.');
        }
        ?>
 <?php 
        eo_the_start($time);
        ?>
</time></div>
          <div class="table-col table-region"><?php 
        the_field('region');
        ?>
</div>
        </li>
        <?php 
    }
    ?>
      </ul>
    
      <?php 
} else {
    ?>
Esempio n. 6
0
function post_class_custom($class = '', $post_id = null)
{
    // Separates classes with a single space, collates classes for post DIV
    echo 'class="' . join(' ', get_post_class($class, $post_id)) . '';
    get_post_type();
    if ('event' == get_post_type()) {
        echo " ";
        echo the_field('region');
        echo " ";
        echo implode(' ', (array) get_field('eventart'));
        echo " ";
        echo implode(' ', (array) get_field('musikgenre'));
        //get multiple values seperated by a space
        echo " ";
        echo implode(' ', (array) get_field('theatergenre'));
        //get multiple values seperated by a space
        echo " ";
        if (eo_is_all_day()) {
            //Format date/time according to whether its an all day event.
            $format = 'Y-m-d';
        } else {
            $format = 'Y-m-d';
        }
        echo " ";
        eo_the_start($format);
        //get Date
    }
    echo '"';
}
							<div class="entry-meta">
								<!-- Output the date of the occurrence-->
								<?php 
        if (eo_is_all_day()) {
            ?>
									<!-- Event is an all day event -->
									<?php 
            eo_the_start('d F Y');
            ?>
 
								<?php 
        } else {
            ?>
									<!-- Event is not an all day event - display time -->
									<?php 
            eo_the_start('d F Y g:ia');
            ?>
 
								<?php 
        }
        ?>

								<!-- If the event has a venue saved, display this-->
								<?php 
        if (eo_get_venue_name()) {
            ?>
									<?php 
            _e('at', 'eventorganiser');
            ?>
 <a href="<?php 
            eo_venue_link();
Esempio n. 8
0
    ?>
        
        <time itemprop="startDate" datetime="<?php 
    eo_the_start($microformat);
    ?>
">
                        	<span class="monat"><?php 
    eo_the_start(M);
    ?>
</span>
                        	<span class="tag"><?php 
    eo_the_start(d);
    ?>
</span>
                        	<span class="zeit"><?php 
    eo_the_start(get_option('time_format'));
    ?>
</span>
                        </time>

	<h2 class="entry-title"><?php 
    the_title();
    ?>
</h2>
		<article id="post-<?php 
    the_ID();
    ?>
" <?php 
    post_class();
    ?>
>
<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>

	<h1><?php 
        the_title();
        ?>
</h1>
	
	<div id="event-date"><h3><?php 
        eo_the_start('l, F jS, Y');
        ?>
 at <?php 
        eo_the_start('g:ia');
        ?>
</h3></div>
	
	<?php 
        if (eo_get_venue()) {
            ?>
		
		<div id="event-venue">
			<h4><?php 
            eo_venue_name();
            ?>
</h4>
		</div>

	<?php