Problems with adding an event in addition to main loop…
-
Hi. I’m trying to display one event at the top of my main blog page….and I can’t seem to get the event to display at all. Instead, it’s just displaying the first post of the blog twice, but without content.
Here is my code:
<?php $events = eo_get_events(array( 'numberposts'=>1, 'event_start_after'=>'today', 'showpastevents'=>true,//Will be deprecated, but set it to true to play it safe. )); ?> <?php if($events): ?> <article class="post"> <a href="<?php the_permalink();?>"><?php if ( has_post_thumbnail() ) { echo get_the_post_thumbnail($page->ID, 'medium', array('class' => 'post-thumbnail')); } ?></a><?php $key = 'Video'; $themeta = get_post_meta($post->ID, $key, TRUE); if($themeta != '') { echo get_post_meta($post->ID, 'Video', true); } ?> <a href="<?php the_permalink();?>"><h2><?php the_title(); ?></h2></a> <div class="entry-content"> <div class="entry-meta"> When: <?php eo_get_next_occurrence('F jS, Y'); ?><br/> Where: <a href="/vetro/directions/"><?php $current_events_venue_id = eo_get_venue(); ?></a> <?php the_content(); ?> </div><!-- .entry-content --> </article><!-- #post-<?php the_ID(); ?> --> <?php endif; ?> <?php global $post; // required $args = array('category' => -10); ?> <?php if (have_posts()): ?> <?php while(have_posts()) : the_post(); ?> <article class="post"> <a href="<?php the_permalink();?>"><?php if ( has_post_thumbnail() ) { echo get_the_post_thumbnail($page->ID, 'medium', array('class' => 'post-thumbnail')); } ?></a><?php $key = 'Video'; $themeta = get_post_meta($post->ID, $key, TRUE); if($themeta != '') { echo get_post_meta($post->ID, 'Video', true); } ?> <a href="<?php the_permalink();?>"><h2><?php the_title(); ?></h2></a> <div class="meta">Posted <span class="entry-date"><?php the_time('m.d.y') ?></span><span class="meta-sep"> by <?php the_author_posts_link(); ?></span> | <a href="<?php comments_link(); ?>">Leave a Comment</a></div><!--meta--> <?php the_content( 'Read more ?' ); ?> <div class="clearfix"></div> </article><!--post--> <?php endwhile; ?> <?php endif; ?>
Any ideas what I’m doing wrong?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Problems with adding an event in addition to main loop…’ is closed to new replies.