<?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' ); ?>
<?php get_template_part('templates/row-projects'); ?>
<main id="maincontent">
  <div class="container">
    <section class="row">
      <div class="col-md-10 col-md-offset-1">
        <?php breadcrumbs(); ?>
      </div>
    </section>
    <section class="row">
      <div class="col-md-10 col-md-offset-1">
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post();?>
        <h1>
          <?php
          global $iris_db;
          $service_from_db = $iris_db->get_row( "SELECT service_name FROM services WHERE old_title='" . get_the_title() . "'" );
          if ( $service_from_db->service_name != '' ) {
              echo $service_from_db->service_name;
          } else {
              ?>
          <?php the_title(); ?>
          <?php } ?>
        </h1>
        <?php the_content(); ?>
        <?php endwhile; else: ?>
        <p>Sorry, no posts matched your criteria.</p>
        <?php endif; ?>
        <?php get_template_part( 'templates/pagination' ); ?>
      </div>
    </section>
  </div>
</main>
<?php get_template_part( 'templates/row-newsletter' ); ?>
<?php get_footer(); ?>
