<?php
/*
Template Name: お知らせ一覧用
*/
?>
<?php get_header();?>

	<div id="top_sub_menu">
		<ul>
			<li><a href="<?php echo home_url('/'); ?>">HOME</a></li>
			<li><a href="<?php echo home_url('/'); ?>history/">歴史</a></li>
			<li><a href="<?php echo home_url('/'); ?>information/">お知らせ</a></li>
			<li><a href="<?php echo home_url('/'); ?>link/">リンク</a></li>
			<li><a href="<?php echo home_url('/'); ?>jimukyoku/">事務局</a></li>
			<li><a href="<?php echo home_url('/'); ?>members-login/">会員専用</a></li>
		</ul>
	</div>

<?php if ( is_home() || is_front_page() ) : ?>
<?php else : ?>
	<div class="page_title">
		<h2>お知らせ</h2>
	</div>
<?php endif; ?>

<div id="contents">

		<article id="main">
			<section class="news_info page sclearfix">
				<ul class="news_info_ul">
					<?php query_posts('posts_per_page=5&category_name=information'); ?>
					<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
						<li class="postList">
							<?php if (has_post_thumbnail()) { ?>
								<div class="postList_img">
									<a class="postList_thumbnail" href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url( 'medium' ); ?>" width="60" height="50"></a>
								</div>
								<div class="postList_main">
									<p class="postList_time"><?php the_time('Y年n月j日'); ?>
									<?php
										$days=7;
										$today=date('U'); $entry=get_the_time('U');
										$diff1=date('U',($today - $entry))/86400;
										if ($days > $diff1) { ?>
										<img src="<?php bloginfo('stylesheet_directory'); ?>/img/top/new.gif" width="18" height="12" alt="new" class="new-img">
									<?php } ?></p>
									<p class="postList_title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></p>
									<p class="postList_content"><a href="<?php the_permalink(); ?>"><?php the_excerpt(); ?></a></p>
								</div>
							<?php  } else { ?>
								<div class="postList_main_noimg">
									<p class="postList_time"><?php the_time('Y年n月j日'); ?>
									<?php
										$days=7;
										$today=date('U'); $entry=get_the_time('U');
										$diff1=date('U',($today - $entry))/86400;
										if ($days > $diff1) { ?>
										<img src="<?php bloginfo('stylesheet_directory'); ?>/img/top/new.gif" width="18" height="12" alt="new" class="new-img">
									<?php } ?></p>
									<p class="postList_title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></p>
									<p class="postList_content"><a href="<?php the_permalink(); ?>"><?php the_excerpt(); ?></a></p>
								</div>
							<?php } ?>
						</li>
					<?php endwhile; endif; ?>
				</ul>
				<?php twentyfourteen_paging_nav(); ?>
				
			</section>
						
			<p id="pageTop"><a data-scroll href="#header"><br>page top</a></p>
		<!-- /main --></article>
	<!-- /contents --></div>

<?php get_footer(); ?>