﻿<?php
/**
  Template Name: Blog Template
 */
get_header();
$redirectedlink = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
?>
<!-- blog -->
<div class="bloc tc-outer-space bgc-white-smoke l-bloc b-divider" id="blog">
	<div class="container bloc-lg">
		<div class="row">
			<div class="col-sm-12">
				<h1 class="text-center mg-md drag-obj animated sm-shadow fadeInUp">
					<?php the_title(); ?>
				</h1>
				<p class="text-center sub-heading mg-lg  sm-shadow animated animDelay02 fadeInUp">
					Just a sample of BLOG.
				</p>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-8">	
				<a name="blog1"></a>
				<?php query_posts('post_type=post&post_status=publish&posts_per_page=10&paged='. get_query_var('paged')); ?>
				<?php if( have_posts() ): ?>
				<?php while( have_posts() ): the_post(); ?>
				<div class="panel panel-sq">
					<div class="panel-body">
						<h4 class="mg-md ">
							<span class="ion ion-clock animated fadeIn"> <?php the_time('Fj日Y年'); ?> <?php //the_time('F jS Y'); ?></span>
						</h4>
						<h3 class="mg-md animated fadeIn">
							<strong><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></strong>
						</h3>
						<div class="divider-h">
							<span class="divider"></span>
						</div>
						<a href="<?php the_permalink(); ?>" class="fullthubimg"><?php the_post_thumbnail(); ?></a>
						<?php the_content(); ?>	
					</div>
				</div>		
				<?php endwhile; ?>
				<div class="navigation">
					<span class="newer"><?php previous_posts_link(__('« もっと新しい記事','example')) ?></span> <span class="older"><?php next_posts_link(__('もっと古い記事 »','example')) ?></span>
				</div><!-- /.navigation -->
				<?php else: ?>
				<div id="post-404" class="noposts">
					<p><?php _e('None found.','example'); ?></p>
				</div><!-- /#post-404 -->
				<?php endif; wp_reset_query(); ?>
			</div>
			<div class="col-sm-4">
				<h5 class="mg-md animated fadeIn sm-shadow">
					<span class="ion ion-ios-book-outline"><strong> 最近の投稿</strong></span>
				</h5>
				<?php
					$args = array( 'numberposts' => '5','post_type' => 'post','post_status' => 'publish', );
					$recent_posts = wp_get_recent_posts( $args );
					foreach( $recent_posts as $recent ){
						echo '<h5 class="mg-md animated hover-underline fadeIn sm-shadow"><a href="' . get_permalink($recent["ID"]) . '">' .   $recent["post_title"].'</a> </h5> ';
					}
				?>
			</div>
		</div>
	</div><!-- blog container END --
</div>
<!-- blog END -->
<?php //edit_post_link(__('Edit this entry.', 'uscestheme'), '<div class="container bloc-lg">', '</div>'); ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>