<?php
/*
 * The template for displaying internal (single) pages
 *
 * This template over-rides index.php.
 *
 * @package IRIS OpenWebsite Version 4.0
 *
 */
?>
<?php get_header(); ?>
<?php get_template_part( 'templates/banner' ); ?>
<main id="maincontent">
  <div class="container">
    <section class="row">
      <div class="col-xxs-12">
        <?php breadcrumbs(); ?>
      </div>
    </section>
    <section class="row">
      <div class="col-xxs-12">
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post();?>
        <h1>
          <?php the_title(); ?>
        </h1>
        <?php the_content(); ?>
        <?php
        global $iris_db_old;
        $tax_news_list = $iris_db_old->get_results( "SELECT newsMonthName FROM t_news_months WHERE newsMonthCurrent = 'no' order by newsMonthName DESC" );


        foreach ( $tax_news_list as $item ) {
            ?>
        <li><a href="/newsletter?issue=<?php echo date('MY',strtotime($item->newsMonthName)); ?>"><?php echo date('F Y',strtotime($item->newsMonthName)); ?></a></li>
        <?php } ?>
        <?php endwhile; else: ?>
        <p>Sorry, no posts matched your criteria.</p>
        <?php endif; ?>
      </div>
    </section>
    <?php get_template_part( 'templates/pagination' ); ?>
  </div>
</main>
<?php get_template_part( 'templates/row-newsletter' ); ?>
<?php get_footer(); ?>
