Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <?php
- $lang = pll_current_language('slug');
- $all_names = array('ko' => '전체', 'en' => 'Total' , 'zh' => '總數', 'ja' => '総合');
- $recent_path = array('ko' => '최신 PATH', 'en' => 'Recent PATH Stories' , 'zh' => '最新樂途故事', 'ja' => '最新のPATHストーリー');
- $recommend_path = array('ko' => '추천 PATH', 'en' => 'Recommended PATH Stories' , 'zh' => '樂途故事推薦', 'ja' => 'おすすめのPATHストーリー');
- $story_path = array('ko' => 'PATH 목록', 'en' => 'PATH Stories Directory' , 'zh' => '樂途故事指南', 'ja' => 'PATHストーリー一覧');
- ?>
- <?php
- //get user like string from cookie for use in later check
- $like_string = mb_cookie_get_key_value ("inspire_cookie", "likes");
- $likes = get_post_meta(get_the_ID(), 'inspire_likes', true);
- if (empty($likes)) $likes = 0;
- $inspire_options_post = get_option('inspire_options_post');
- $layout = $inspire_options_post['post_style']; //single, full, full_sidebar
- switch ($layout) {
- case "single":
- $featured_img_width = 650;
- break;
- case "full":
- $featured_img_width = 990;
- break;
- case "full_sidebar":
- $featured_img_width = 990;
- break;
- default:
- $featured_img_width = 650;
- break;
- }
- $post_thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full');
- if ($post_thumbnail_src[1] < $featured_img_width) $featured_img_width = $post_thumbnail_src[1];
- //get attachments
- $args = array(
- 'post_type' => 'attachment',
- 'numberposts' => -1,
- 'post_status' => null,
- 'post_parent' => $post->ID
- );
- $project_attachments = get_posts( $args );
- //var_dump($project_attachments);
- ?>
- <!-- FEATURED IMAGE FOR FULL_SIDEBAR-->
- <?php
- if (has_post_thumbnail(get_the_ID()) && $layout == "full_sidebar" && isset($inspire_options_post['show_featured'])) {
- ?>
- <div class='post-img full'>
- <div class='flexslider flexslider_single'>
- <ul class="slides">
- <?php printf("<li><a href='%s'><img width='%d' src='%s'></a></li>", esc_url($post_thumbnail_src[0]), esc_attr($featured_img_width), esc_url($post_thumbnail_src[0])); ?>
- <?php
- for ($i = 0; $i < count($project_attachments); $i++) {
- if (get_post_thumbnail_id(get_the_ID()) != $project_attachments[$i]->ID) {
- $attachment_src = wp_get_attachment_image_src($project_attachments[$i]->ID, 'full');
- printf("<li><a href='%s'><img width='%d' src='%s'></a></li>", esc_url($attachment_src[0]), esc_attr($featured_img_width), esc_url($attachment_src[0]));
- }
- }
- ?>
- </ul>
- </div>
- </div>
- <?php
- }
- ?>
- <div id="content" class="<?php echo $layout; ?>">
- <!-- BEGIN LOOP -->
- <?php while ( have_posts() ) : the_post(); ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class($layout); ?> data-post_ID="<?php the_ID(); ?>" data-nonce="<?php echo wp_create_nonce('like_post'); ?>">
- <!-- FEATURED IMAGE FOR SINGLE & FULL-->
- <!-- TITLE AND META -->
- <div class="post-title">
- <!-- <strong><?php echo get_post_meta(get_the_ID(), 'cmb_slider_cap_text', true); ?></strong> -->
- <h1><?php the_title(); ?></h1>
- </div>
- <!-- MAIN CONTENT AND TAGS -->
- <div class="post-entry">
- <?php the_content(); ?>
- <?php wp_link_pages(); ?>
- <div class="clearfix"></div>
- <!-- <div class="tags">
- <?php the_tags("",""); ?>
- </div> -->
- </div>
- <!-- POST PAGINATION -->
- <div class="with_path">
- <h4><?php echo $recent_path[$lang] ?></h4>
- <ul>
- <?php
- $categories = get_the_category();
- // print_r($categories);
- // foreach ($categories as $category){
- // echo "==========================".$category->category_parent;
- // }
- $parent_id = trim(esc_html(end($categories)->category_parent));
- $parent_url = get_category_link($parent_id);
- $parent_name = get_category($parent_id)->cat_name;
- //bitly 정보 확인
- $short_url = get_bilty_url($post->ID);
- $link_title = get_the_title();
- ?>
- <?php
- // wp_reset_query();
- // $cat_id = the_category_ID($echo);
- // $cur_cat = new WP_Query();
- // $cur_cat->Query('posts_per_page=5&cat='.$cat_id);
- $category = get_the_category();
- $parent_id = trim(esc_html(end($category)->category_parent));
- $parent_url = get_category_link($parent_id);
- $date = get_the_date('Y-m-d H:i:s');
- $args = array(
- 'cat' => $parent_id,
- 'date_query' => array(
- 'before' => $date,
- 'inclusive' => true
- ),
- 'posts_per_page' => 5,
- );
- $cur_cat = new WP_Query( $args );
- while($cur_cat->have_posts()) : $cur_cat->the_post();
- ?>
- <li><a href="<?php echo the_permalink();?>"><?php echo the_title();?></a></li>
- <?php
- endwhile;
- ?>
- <script type="text/javascript">
- jQuery(document).ready(function(){
- // 사용할 앱의 JavaScript 키를 설정해 주세요.
- Kakao.init('ee656f365475d7c191508379e7f03f5c');
- // 카카오톡 링크 버튼을 생성합니다. 처음 한번만 호출하면 됩니다.
- Kakao.Link.createTalkLinkButton({
- container: '.sns_kt',
- label: '카카오링크 샘플에 오신 것을 환영합니다.',
- image: {
- src: 'http://dn.api1.kage.kakao.co.kr/14/dn/btqaWmFftyx/tBbQPH764Maw2R6IBhXd6K/o.jpg',
- width: '300',
- height: '200'
- },
- webButton: {
- text: '카카오 디벨로퍼스',
- url: 'https://dev.kakao.com/docs/js' // 앱 설정의 웹 플랫폼에 등록한 도메인의 URL이어야 합니다.
- }
- });
- });
- </script>
- </ul>
- </div>
- <div class="btns">
- <div class="sns_box clearfix">
- <ul>
- <li><a href="https://twitter.com/intent/tweet?text=<?=$link_title?>&url=<?=urlencode($short_url)?>" class="sns_tw" target="_blank" title="Twitter">Twitter</a></li>
- <li><a href="http://www.facebook.com/sharer.php?u=<?=urlencode($short_url)?>" class="sns_fb" target="_blank" title="Facebook">Facebook</a></li>
- <li><a href="https://story.kakao.com/share?url=<?=urlencode($short_url)?>" class="sns_ks" target="_blank" title="Kakaostory">Kakaostory</a></li>
- <li><a href="javascript:;" class="sns_kt" target="_blank" title="Kakaotalk">Kakaotalk</a></li>
- <li><a href="http://line.naver.jp/R/msg/text/?<?=urlencode($short_url)?>=<?=urlencode($short_url)?>" class="sns_ln" target="_blank" title="Line">Line</a></li>
- <li><a href="whatsapp://send?text=<?=urlencode($short_url)?>" data-action="share/whatsapp/share" class="sns_wa">Whatsapp</a></li>
- </ul>
- </div>
- <a href="<?php echo $parent_url; ?>"><?php echo $parent_name; ?></a>
- </div>
- <div class="recommend_list">
- <h2><?php echo $recommend_path[$lang] ?></h2>
- <ul class="clearfix">
- <?php
- wp_reset_query();
- $cat_id = get_category_by_slug('recommend')->cat_ID;
- $cur_cat = new WP_Query();
- $cur_cat->Query('posts_per_page=3&cat='.$cat_id);
- while($cur_cat->have_posts()) {
- $cur_cat->the_post();
- $post_thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),"full");
- $category = get_the_category();
- $title = get_the_title();
- $excerpt = get_the_content();
- $link = get_permalink();
- $vol = get_post_meta(get_the_ID(), 'cmb_slider_cap_text', true);
- ?>
- <li>
- <a href="<?php echo $link; ?>">
- <span class="thumb"><img src="<?php echo $post_thumbnail_src[0]; ?>" alt="" /></span>
- <div class="inner">
- <span class="vol"><?php echo $vol; ?></span>
- <strong class="title"><?php echo $title; ?></strong>
- <span class="desc"><?php echo trim(mb_make_excerpt($excerpt, 200, true)); ?></span>
- </div>
- </a>
- </li>
- <?php
- }
- ?>
- </ul>
- </div>
- <!-- SHARE THE LOVE -->
- <?php if (isset($inspire_options_post ['show_share'])) get_template_part('inc/templates/template_post_share'); ?>
- <!-- COMMENTS -->
- <?php if (isset($inspire_options_post ['show_comments'])) comments_template( '', true ); ?>
- </div>
- <!-- class: post -->
- <?php endwhile; ?>
- <!-- END LOOP -->
- </div> <!-- id:content -->
- <?php if ($layout == "single" || $layout == "full_sidebar") get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement