<?php
crum_header();
$options = get_option('second-touch');

get_template_part('templates/top', 'page'); ?>

<section id="layout">
<!-- www.20script.ir -->
    <div class="row">

        <?php

        set_layout('single', true);


        while (have_posts()) : the_post(); ?>

            <article <?php post_class(); ?>>

                <?php
                if (($options["post_share_button"]) || ($options["custom_share_code"])) {

                    get_template_part('templates/single', 'social');

                } ?>

                <div class="ovh">
					<?php if(is_single()){ ?>
                    <h1 class="entry-title"><?php the_title(); ?></h1>
					<?php }else{?>
					<h2 class="entry-title"><?php the_title(); ?></h2>
					<?php }?>
                    <?php
                    if ($options['thumb_inner_disp'] == '1') {
                        if (has_post_thumbnail()) {
                            $thumb = get_post_thumbnail_id();
                            $img_url = wp_get_attachment_url($thumb, 'full'); //get img URL

                                $article_image = aq_resize($img_url, 1200, 500, true);

                            ?>
                            <div class="post-media clearfix">
                                <div class="entry-thumb">
                                    <img src="<?php echo $article_image ?>" alt="<?php the_title(); ?>"/>
                                </div>
                            </div>
                        <?php
                        }
                    }
                    ?>

                    <div class="entry-content">

                        <?php  if (has_post_format('video')) {

                            get_template_part('templates/post', 'video');

                        } elseif (has_post_format('gallery')) {
                            get_template_part('templates/post', 'gallery');
                        }
                        if (has_post_format('audio')) {
                            get_template_part('templates/post', 'audio');

                        }
                        the_content(); ?>

                    </div>

                    <?php wp_link_pages(array('before' => '<nav class="page-nav"><p>' . __('Pages:', 'crum'), 'after' => '</p></nav>')); ?>

                </div>

            </article>

        <?php endwhile; ?>

        <?php    if ($options["autor_box_disp"] == '1') {

            get_template_part('templates/author-box');
        }

        comments_template();


        set_layout('single', false);

        ?>

    </div>
</section>
<?php crum_footer();?>
