-
-
Save bynicolas/17e791a2361bfb227d2a6e251ce32806 to your computer and use it in GitHub Desktop.
Event single post template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<div class="singleEventContainer"> | |
<div class="singleEventHeader"> | |
<?php if (have_posts()) : ?> | |
<?php if (class_exists('MultiPostThumbnails')) : | |
MultiPostThumbnails::the_post_thumbnail('event', 'header-image', NULL, 'full', NULL, false); | |
endif; ?> | |
</div> | |
<div class="singleEvent"> | |
<h1 class="<?php echo get_post_meta($post->ID, 'Event Text Left or Right', true); ?>"><?php echo get_post_meta($post->ID, 'Event Title', true); ?> | |
</h1> | |
</div> | |
<div class="singleEventTicketButton"> | |
<a class=" <?php echo get_post_meta($post->ID, 'Event Text Left or Right', true); ?>" href="<?php echo get_post_meta($post->ID, 'Ticket Purchase Link', true); ?>" target="_blank"><?php echo get_post_meta($post->ID, 'Ticket Button Text', true); ?> | |
</a> | |
</div> | |
</div> | |
<div id="content"> | |
<div class="singlePost"> | |
<?php while (have_posts()) : the_post(); ?> | |
<div class="programIcon"><?php if (class_exists('MultiPostThumbnails')) : | |
MultiPostThumbnails::the_post_thumbnail('event', 'program-icon', NULL, 'full', NULL, false); | |
endif; ?> | |
</div> | |
<div class="singleEventDate"> | |
<?php echo get_post_meta( get_the_ID(), 'Event Date', true ); ?> | |
</div> | |
<div class="singleEventTitle"> | |
<?php echo get_post_meta( get_the_ID(), 'Event Title', true ); ?> | |
</div> | |
<?php the_content(); ?> | |
<?php endwhile; else : ?> | |
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> | |
<?php endif; ?> | |
<?php | |
$event_title = get_the_title(); // This is the title of the current single event page we are on. | |
$args = array( | |
'meta_key' => 'event_name', // the name of your custom field | |
'meta_value' => $event_title, | |
'post_type' => 'speakers', | |
); | |
$speakers_query = new WP_Query( $args ); | |
if( $speakers_query->have_posts() ) : | |
echo '<div class="eventSpeakers"><ul>'; // start your section here | |
while( $speakers_query->have_posts() ) : $speakers_query->the_post(); | |
// echo your speaker content here like name, images, etc. | |
echo '<li>' . get_the_title() . '</li>'; | |
endwhile; | |
echo '</ul></div>'; // end your section here | |
wp_reset_postdata(); | |
endif; ?> | |
</div> | |
</div> | |
<div class="eventFeaturedBlock"> | |
<?php | |
while (have_posts()) : the_post(); | |
if (class_exists('MultiPostThumbnails')) : | |
MultiPostThumbnails::the_post_thumbnail( | |
get_post_type(), | |
'featured-block', $post->ID, 'full',NULL, FALSE); endif; | |
?> | |
<div class="featuredBlockSubheader"> | |
<?php echo get_post_meta( get_the_ID(), 'Featured Block Subheader', true ); ?> | |
</div> | |
<div class="featuredBlockTitle"> | |
<?php echo get_post_meta( get_the_ID(), 'Featured Block Title', true ); ?> | |
</div> | |
<div class="featuredBlockText"> | |
<?php echo get_post_meta( get_the_ID(), 'Featured Block Text', true ); ?> | |
</div> | |
<?php endwhile; ?> | |
</div> | |
<div class="eventMenu"> | |
<?php | |
while (have_posts()) : the_post(); | |
if (class_exists('MultiPostThumbnails')) : | |
MultiPostThumbnails::the_post_thumbnail( | |
get_post_type(), | |
'menu-background', $post->ID, 'full',NULL, FALSE); endif; | |
?> | |
<div class="providedBy"> | |
<?php echo get_post_meta( get_the_ID(), 'Menu Provided By', true ); ?> | |
</div> | |
<div class="menuTitle"> | |
<?php echo get_post_meta( get_the_ID(), 'Menu Title', true ); ?> | |
</div> | |
<ul class="MenuItems"> | |
<?php | |
$menuItems = get_post_meta($post->ID, "Menu Item", false); | |
if ($menuItems[0]=="") { ?> | |
<?php } else { ?> | |
<?php foreach($menuItems as $menuItems) { | |
echo '<li>'.$menuItems.'</li>'; | |
} ?> | |
<?php } ?> | |
<?php endwhile; ?> | |
</ul> | |
</div> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment