<?php
the_post();
$page_title = get_the_title();
$thisContent = get_the_content();
$page_description = str_replace(PHP_EOL, "", mb_strimwidth(strip_tags($thisContent), 0, 350, "..."));

$cat_info = get_the_category()[0];
$cat_name = $cat_info->name;
$cat_slug = $cat_info->slug;

$ogImage = "";
$thumbnail_id = get_post_thumbnail_id($post->ID);
$hasThumbnail = wp_get_attachment_image_src($thumbnail_id, "full");
if($hasThumbnail){
	$ogImage = $hasThumbnail[0];
}
if(!$hasThumbnail){
	$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $thisContent, $matches);
	$ogImage = $matches[1][0] ?? null;
}
if(!$ogImage){
	$ogImage = "https://members-soleil.com/img/og_image.jpg";
}
?>
<!doctype html>
<html lang="ja" prefix="og: http://ogp.me/ns#"><!-- InstanceBegin template="/Templates/soleil.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-KCL6S3EK1K"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-KCL6S3EK1K');
</script>
<meta charset="utf-8">
<!-- InstanceBeginEditable name="doctitle" -->
<title><?=$page_title ?> - Le Soleil ソレイユ</title>
<meta name="description" content="<?php echo $page_description; ?>" />
<meta property="og:title" content="<?=$page_title ?> - Le Soleil ソレイユ">
<meta property="og:description" content="<?php echo $page_description; ?>">
<meta property="og:type" content="article">
<meta property="og:url" content="<?php the_permalink() ?>">
<meta property="og:image" content="<?php echo $ogImage; ?>">
<?php wp_head(); ?>
<!-- InstanceEndEditable -->
<meta property="og:locale" content="ja_JP">
<meta property="og:site_name" content="Le Soleil ソレイユ">
<meta name="viewport" content="width=device-width">
<meta name="keywords" content="Le Soleil,ソレイユ,ラウンジ,神戸,三宮"/>
<meta name="format-detection" content="telephone=no">
<meta name="theme-color" content="#1a0c02">
<link rel="icon" type="image/x-icon" href="https://members-soleil.com/img/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="https://members-soleil.com/img/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="https://members-soleil.com/img/favicons/android-chrome-192x192.png">
<link rel="stylesheet" type="text/css" href="/css/opt.css">
<link rel="stylesheet" type="text/css" href="/css/common.css">
<script src="https://kit.fontawesome.com/cfffd57400.js" crossorigin="anonymous"></script>
<script src="/js/jquery-3.4.1.min.js"></script>
<script src="/js/base.js"></script>
<style>
</style>
<!-- InstanceBeginEditable name="head" -->
<link rel="stylesheet" type="text/css" href="../../../../css/sub.css">
<link rel="stylesheet" type="text/css" href="../../../../css/news.css">
<link rel="stylesheet" type="text/css" href="../../../../css/cms.css">
<!-- InstanceEndEditable -->
</head>
<body>
<div id="wrapper">
<header>
  <div class="h_inner">
<h1 class="logo">
		  <a href="https://members-soleil.com/"><img src="../../../../img/common/h-logo.svg" alt="Le Soleil ソレイユ"></a>			
	  </h1>
	  <div class="toggle grip-lines"></div>
		<div class="gnavArea">
			<p class="gnav_logo"><a href="https://members-soleil.com/"><img src="../../../../img/common/f-logo.svg" alt="Le Soleil ソレイユ"></a></p>
			<div class="gnav_wrap">
				<ul class="gnav">
					<li><a href="https://members-soleil.com/">Home</a></li>
					<li><a href="https://members-soleil.com/topics/">News</a></li>
					<li><a href="../../../../system.html">System</a></li>
					<li><a href="../../../../access.html">Access</a></li>
					<li><a href="../../../../recruit.html">Recruit</a></li>
					<li class="gnav_contact"><a href="https://members-soleil.com/topics//contact/">Contact</a></li>
				</ul>
				<ul class="sns">
					<li><a href="https://www.instagram.com/yukari_soleil/" target="_blank"><span class="fab fa-instagram" aria-hidden="true"></span></a></li>
					<li><a href="https://www.facebook.com/soleil.sannomiya" target="_blank"><span class="fab fa-facebook" aria-hidden="true"></span></a></li>
					<!--<li><a href="#" target="_blank"><span class="fab fa-twitter" aria-hidden="true"></span></a></li>-->
				</ul>
			</div>
		</div>
  </div>
</header>
<!-- InstanceBeginEditable name="main" -->
<main>
  <div class="titleArea newsTitle">
	<div class="inner">
		<h1>ニュース</h1>
	</div>
  </div>
	<div class="breadArea02">
		<ul class="inner">
			<li><a href="https://members-soleil.com/">HOME</a></li>
			<li><a href="https://members-soleil.com/topics/">NEWS LIST</a></li>
			<li><?php echo mb_strimwidth(get_the_title(), 0, 40, "..."); ?></li>
		</ul>
	</div>
	<div class="newsArea singleArea">
      <div class="inner fadeUpTrigger">
			<div class="desc">
				<h1 class="tit yum"><?php the_title(); ?></h1>
				<div class="date"><?php the_date("Y-m-d"); ?></div>
				<div class="content">
				<?php the_content();?>
				</div>
			</div>
			<div class="pager">
              <ul>
                <span class="fleft"><?php previous_post_link("<li class=\"prev\">%link</li>", "< prev"); ?></span>
                <span class="fright"><?php next_post_link("<li class=\"next\">%link</li>", "next >"); ?></span>
              </ul>
            </div>
		</div>
  </div>
</main>
<!-- InstanceEndEditable -->
<footer>
	<div class="inner">
		<p class="f_logo"><a href="https://members-soleil.com/"><img src="../../../../img/common/f-logo.svg" alt="Le Soleil ソレイユ"></a></p>
		<ul class="snsArea">
			<li><a href="https://www.instagram.com/yukari_soleil/" target="_blank"><span class="fab fa-instagram" aria-hidden="true"></span></a></li>
			<li><a href="https://www.facebook.com/soleil.sannomiya" target="_blank"><span class="fab fa-facebook" aria-hidden="true"></span></a></li>
			<!--<li><a href="#" target="_blank"><span class="fab fa-twitter" aria-hidden="true"></span></a></li>-->
		</ul>				
	</div>
	<p class="pagetop"><a><span class="fa fa-chevron-up" aria-hidden="true"></span></a></p>
	<div class="copy"><p>&copy;  Le Soleil</p></div>
</footer>
</div>
<!-- InstanceBeginEditable name="foot-js" -->
<script>
	var height=window.innerHeight;
	document.documentElement.style.setProperty( '--vh', height/100 + 'px');
</script> 
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
