<?php

  # Load post data
  the_post();

  # Retrieve settings
  $page_settings  = get_kob_meta(get_the_ID(), 'page_settings');
  $data           = get_kob_meta( get_the_ID(), 'page_gallery' );
  $content        = get_the_content();
  $heading        = get_the_title();
  $show_prefooter = $page_settings ? $page_settings->show_prefooter : false;

  # Images
  $images = $data ? get_images_from_gallery( $data->gallery ) : array();
  $content = apply_images( $content, $images );
  $content = apply_filters( 'the_content', $content );

  # Page
  get_header();

    view( 'partials/new/menu-classic', 'main' );
    view( 'partials/headings', 'simple', array('heading' => $heading) );
    wrap( 'start', 'container' );
      view( 'partials/contents', 'base', array('content' => $content) );
    wrap( 'end' );
    view_if( $show_prefooter, 'partials/common', 'pre-footer' );
    view( 'partials/common', 'footer' );
  get_footer();
