<?php get_header(); ?>
<body <?php body_class(); ?>>
<div id="options" class="<?php $options = get_option('myd_theme_options'); if (!empty($options[layout])) { echo esc_html($options[layout]); } else { echo 'c2r'; } ?> <?php $options = get_option('myd_theme_options');echo esc_html($options['background_color_tone']);?>" >
	<?php get_template_part( 'banner' ); ?>

	<div class="l-container" id="container">
		<?php breadcrumb(); ?>

		<div class="l-main_sidebar1">
			<div class="l-main main" id="main" role="main">
				<?php {dynamic_sidebar('single_main_top');}?>

				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
					<header class="entry-header">
						<h1>
							<span class="entry-title">
								<?php if (get_post_meta($post->ID, "customh1", true)) : ?>
								<?php $key="customh1"; echo get_post_meta($post->ID, $key, true); ?>
								<?php else : ?>
								<?php the_title(); ?>
								<?php endif; ?>
							</span>
						</h1>
					</header>

					<!-- <?php get_template_part('social-button'); ?> -->

					<section class="entry-content">
						<?php {dynamic_sidebar('single_main_post_content_top');}?>
						<?php if (has_post_thumbnail()) { the_post_thumbnail(); } ?>
						<?php the_content(); ?>
						<?php wp_link_pages(); ?>
						<?php {dynamic_sidebar('single_main_post_content_bottom');}?>
					</section>

					<?php get_template_part('social-button'); ?>

					<footer class="entry-meta">
						<div class="entry-meta-item tag"><?php the_tags('<i class="fa fa-tags"></i> ', ' &bull; '); ?></div>
						<span class="entry-meta-item date updated"><time datetime="<?php echo the_time('Y-m-j'); ?>" pubdate><?php the_time( get_option('date_format') ) ;?></time></span>
						<span class="entry-meta-item vcard author"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author_meta('display_name'); ?></a></span>
						<span class="entry-meta-item comments"><?php comments_popup_link('コメントはありません。', 'コメントが1件あります。', 'コメントが%件あります。', 'コメントは受け付けていません' ); ?></span>
						<span class="entry-meta-item category"><?php the_category(' '); ?></span>
						<span class="entry-meta-item edit_post"><?php edit_post_link('編集',''); ?></span>
					</footer>

					<?php comments_template('', true); ?>

					<nav class="entry-navi">
						<div class="previous"><?php previous_post_link('%link') ?></div>
						<div class="next"><?php next_post_link('%link') ?></div>
					</nav>
				</article>
				<?php endwhile; endif; ?>

				<?php {dynamic_sidebar('single_main_bottom');}?>

			</div>

			<?php get_sidebar('1'); ?>
		</div>

		<?php get_sidebar('2'); ?>
	</div>

	<?php get_footer(); ?>

