PageRenderTime 257ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/themes/OneMozilla-Air/content-featured.php

https://github.com/fvignals/One-Mozilla-blog
PHP | 34 lines | 33 code | 1 blank | 0 comment | 6 complexity | 6871c97e3a3093ddbd64c541c845f947 MD5 | raw file
  1. <?php
  2. $date_format = get_option( 'date_format' );
  3. $time_format = get_option( 'time_format' );
  4. $eventdate = get_post_meta($post->ID, 'eventdate', true);
  5. ?>
  6. <article id="feature-<?php the_ID(); ?>" <?php post_class('main-feature'); ?>>
  7. <header>
  8. <hgroup>
  9. <?php if (has_tag('live')) : ?>
  10. <h2 class="feature-type"><?php _e('Streaming Live Now','airmoz'); ?></h2>
  11. <?php else : ?>
  12. <h2 class="feature-type"><?php _e('Featured Video','airmoz'); ?></h2>
  13. <?php endif; ?>
  14. <h3 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permanent link to &ldquo;%s&rdquo;', 'onemozilla' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
  15. </hgroup>
  16. <?php if ($eventdate) : ?>
  17. <p class="event-date"><?php echo esc_attr($eventdate); ?></p>
  18. <?php else : ?>
  19. <p class="event-date"><time class="published" datetime="<?php the_time('Y-m-d\TH:i:sP'); ?>"><?php the_time($date_format.' '.$time_format); ?></time></p>
  20. <?php endif; ?>
  21. </header>
  22. <div class="entry-summary">
  23. <a href="<?php the_permalink(); ?>">
  24. <?php if (has_post_thumbnail()) : ?>
  25. <?php the_post_thumbnail(array(160,160), array('alt' => "", 'title' => ""));?>
  26. <?php else : ?>
  27. <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/thumbnail.png" alt="" width="160" height="160" class="wp-post-image">
  28. <?php endif; ?>
  29. </a>
  30. <?php the_excerpt(); ?>
  31. <p class="watch"><a class="button" href="<?php the_permalink(); ?>"><?php _e('Watch Now','airmoz'); ?></a></p>
  32. </div><!-- .entry-summary -->
  33. </article><!-- #post-<?php the_ID(); ?> -->