Advertisement
geminith7

Untitled

Aug 23rd, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.45 KB | None | 0 0
  1. <?php get_header(); ?>
  2. </div>
  3. <div class="st3-title"><img src="<?php echo get_template_directory_uri(); ?>/images/banner-default.svg"></div>
  4. <div id="right-side">
  5.     <div class="st3-entry">
  6.  
  7.         <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  8.             <!-- Conten fix -->
  9.             <div class="book-container">
  10.                 <div class="book">
  11.                     <div class="stfic-cover">
  12.                         <div class="book-ridge"></div>
  13.                         <?php if ( has_post_thumbnail() ) { ?>
  14.                             <a href="<?php the_post_thumbnail_url(); ?>"><?php the_post_thumbnail(); ?></a>
  15.                             <?php
  16.                         } else { ?>  
  17.                             <div class="book-defaultcv">
  18.                                 <h4 style="text-transform:uppercase; margin-top:0px"><?php the_title(); ?></h3>
  19.                                 <div class="st3-infoline" style="width:50%; margin: 0 auto;"></div>
  20.                                 <em>
  21.                                     <?php if ( get_post_meta($post->ID, $prefix . 'b_author', true ) ): ?>
  22.                                         <?php echo esc_html( get_post_meta($post->ID, 'st_series_b_author', TRUE) ); ?>
  23.                                     <?php else: ?>
  24.                                         <?php the_author(); ?>
  25.                                     <?php endif ?>
  26.                                 </em>
  27.                             </div>
  28.                         <?php } ?>
  29.                     </div>
  30.                     <div class="book-info">
  31.                          <ul>
  32.                             <h3 style="text-transform:uppercase; margin-top:0px"><?php the_title(); ?></h3>
  33.                             <p><strong>• Tác giả: </strong><em>
  34.                                 <?php if ( get_post_meta($post->ID, $prefix . 'b_author', true ) ): ?>
  35.                                     <a href="<?php echo esc_url( home_url( '/' ) ); ?>index.php?s=<?php echo esc_html( get_post_meta( $post->ID, 'st_series_b_author', true ) ); ?>" style="color:green"> <?php echo esc_html( get_post_meta($post->ID, 'st_series_b_author', TRUE) ); ?> </a>
  36.                                 <?php else: ?>
  37.                                         <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" style="color:green"><?php the_author(); ?></a>
  38.                                 <?php endif ?>
  39.                             </em></p>
  40.                             <p><strong>• Thể loại: </strong><em>
  41.                                 <?php if( has_term( '', 'stfic-theloai' ) ) { echo the_terms( $post->ID, 'stfic-theloai', '', ' / ' ); }
  42.                                 else
  43.                                     echo 'Chưa xác định';
  44.                                 ?>                             
  45.                             </em></p>
  46.                             <p><strong>• Series: </strong><em>
  47.                                 <?php if( has_term( '', 'stfic-series' ) ) { echo the_terms( $post->ID, 'stfic-series' ); }
  48.                                 else
  49.                                     echo 'Chưa biết';
  50.                                  ?>
  51.                             </em></p>
  52.                             <p><span><strong>• Đánh giá: </strong><?php echo csr_get_overall_rating_stars($post_id = 0); ?> (<?php echo csr_get_overall_rating ($post_id = 0); ?>)</span></p>                         
  53.                             <div class="st3-infoline"></div>                           
  54.                             <p><strong>• Trạng thái: </strong><em style="color:#9c979d"><?php echo esc_html( get_post_meta( get_the_ID(), 'st_series_b_status', true ) ); ?></em></p>
  55.                             <p><strong>• Mã sách: </strong><span id="textToCopy"><?php echo get_post_meta( get_the_ID(), 'bookcode', true ); ?></span>
  56.                             <button id="copyButton"><i class="fa fa-clipboard" aria-hidden="true" title="Nhấn vào đây để sao chép mã sách"></i></button>
  57.                             <span id="copyResult"></span>
  58.                             <script src="<?php echo get_template_directory_uri(); ?>/js/copytext.js"></script>
  59.                             </p>
  60.                             <?php
  61.                                 $pgi = get_post_meta($post->ID, $prefix . 'b_warn', true);
  62.                                 if(is_array($pgi)) {
  63.                                     echo'<p><strong>• Cảnh báo</strong><span style="small">  <i class="fa fa-question-circle" style="color:#c6c4c9"></i></span></p>';
  64.                                     foreach($pgi as $option['value']){ echo '<div class="book-rates"><img src="'.$option['value'].'"></div>';}
  65.                                 }
  66.                             ?>
  67.                         </ul>
  68.                     </div>
  69.                 </div>
  70.                 <div class="vide"></div>
  71.                 <div class="st3-infoline"></div>
  72.  
  73.                 <!--Social share-->
  74.                 <div class="st3-minishare" style="margin-top: 0"><?php st3_social_share() ?></div>
  75.             </div>
  76.            
  77.             <!-- Content fix -->
  78.             <h3><p>Sơ lược:</p></h3>
  79.             <?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
  80.             <div class="spacer"></div>
  81.             <div class="st3-editform"><?php edit_post_link('<i class="fa fa-pencil-square-o" style="color:#757378" title="Chỉnh sửa bài viết"></i>')?></div>
  82.             <p><div class="st3-hori"></div></p>
  83.  
  84.             <!--Mục lục-->
  85.             <div class="st3-toc">
  86.                 <h3 style="text-align:center"><p>MỤC LỤC:</p></h3>
  87.                 <?php
  88.                     $terms = get_the_terms( $post->ID , 'stfic-manuscripts' );
  89.                     if ( $terms != null ){
  90.                         foreach( $terms as $term ) {
  91.                             $termSlug = $term->slug;
  92.                             unset($term);
  93.                         }
  94.                     }
  95.                 ?>
  96.  
  97.                 <?php
  98.                     $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
  99.                     echo $term->slug; // will show the slug
  100.                         $args = array(
  101.                         'post_type' => 'stfic-child',
  102.                         'posts_per_page' => -1,
  103.                         'post_status' => 'publish',
  104.                         'order' => 'ASC',
  105.                         'post_parent' => 0,
  106.                         'stfic-manuscripts' => $termSlug
  107.                         );
  108.                     $query = new WP_Query( $args );
  109.                         while ( $query->have_posts($post->ID) ) : $query->the_post();
  110.                             echo '<li><a href="'. get_permalink(). '">' .get_the_title() .'</a></li>';  
  111.                         endwhile;
  112.                     wp_reset_query();
  113.                 ?>
  114.             </div>
  115.             <!--Mục lục-->
  116.         <div class="st3-hori"></div>
  117.         <div class="vide"></div><br \><br \>
  118.         <?php comments_template( '/comments-rating.php', true ); ?>
  119.  
  120.     <?php endwhile; else: ?>
  121.     <p><?php _e('Mones rất lấy làm tiếc, nhưng hiện tại ở đây có lẽ không có bài viết nào phù hợp với yêu cầu của bạn.'); ?></p>
  122.     <?php endif; ?>
  123.     </div>
  124. </div>
  125. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement