Skip to content

Instantly share code, notes, and snippets.

@martinsteel
Created November 29, 2012 09:28
Show Gist options
  • Save martinsteel/4167796 to your computer and use it in GitHub Desktop.
Save martinsteel/4167796 to your computer and use it in GitHub Desktop.
WordPress Service Status archive
<?php
get_header();
?>
<?php if (have_posts()) : ?>
<div id="Intro" class="curve">
<h1>Service Status</h1>
<p>How things are running at mediaburst <?php if ( is_day() ) : ?> for <?php get_the_date('jS M Y'); ?> <?php elseif ( is_month() ) : ?> for <?php echo get_the_date('F Y'); ?><?php elseif ( is_year() ) : ?> for <?php echo get_the_date('Y'); ?><?php endif; ?>.</p>
</div>
<div class="group">
<div class="column column-one" style="font-size: 1.2em">
<?php $cdate = ''; ?>
<?php while (have_posts()) : the_post(); ?>
<?php
if($cdate != '' && $cdate != get_the_date('YMj')) {
echo '<hr />';
}
if($cdate != get_the_date('YMj')) {
echo '<h2>'.get_the_date('jS M Y').'</h2>';
}
$cdate = get_the_date('YMj');
?>
<div class="service-status-archive">
<span class="time"><?php echo get_the_date('g:ia'); ?></span>
<p><?php the_title(''); ?></p>
<a href="<?php the_permalink() ?>">view details</a>
</div>
<?php endwhile; ?>
<?php if(function_exists('wp_pagenavi')): wp_pagenavi(); endif; ?>
<?php else : ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment