jegtheme

Category to top

Apr 10th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.67 KB | None | 0 0
  1. <?php
  2.     /**
  3.      * Single post template
  4.      * @author Jegbagus
  5.      */
  6.     global $post;
  7.     global $jdata; 
  8. ?>
  9. <div id="post-<?php the_ID(); ?>"  <?php post_class(array('blogentry','containerborder')); ?>>
  10.     <div class="inner-container <?php if(has_post_thumbnail()) { echo "headimg" ; } ?>">
  11.         <div class="blog-img">
  12.             <?php if(has_post_thumbnail()) : ?>    
  13.             <a href="<?php the_permalink(); ?>">               
  14.                 <?php $imageHeader = j_get_post_header_image ($post, 'full'); ?>
  15.                 <img src="<?php echo jeg_get_image($imageHeader['src'], $jdata->postImageDim); ?>" alt="<?php echo $imageHeader['alt']?>">
  16.             </a>
  17.             <?php endif; ?>
  18.            
  19.             <div class="blogtitle  <?php if(has_post_thumbnail()) { echo "headingwithimage" ; } ?>">
  20.                 <?php if(!is_single() && !is_page()) : ?>
  21.                 <h2>
  22.                     <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>          
  23.                 </h2>
  24.                 <?php  else : ?>
  25.                 <h1>               
  26.                     <?php the_title(); ?>
  27.                 </h1>
  28.                 <?php endif; ?>
  29.             </div>             
  30.         </div>
  31.        
  32.                
  33.         <?php
  34.         if(isset($jdata->hideMeta) && !$jdata->hideMeta) : ?>
  35.         <div class="portfolio-meta blog-meta">
  36.             <ul>           
  37.                 <li class="addby"><i class="icon-user"></i><?php the_author_posts_link(); ?></li>
  38.                 <li class="addtime"><i class="icon-time"></i><?php echo get_the_date(); ?></li>
  39.                 <?php if(isset($jdata->hideComment) && !$jdata->hideComment) { ?>
  40.                 <li class="commentcount"><i class="icon-comment"></i>
  41.                     <a href="<?php the_permalink();?>#comments">
  42.                         <?php
  43.                             $zerocomment    = j__( 'zerocomment_lang', '0 Comment');
  44.                             $onecomment     = j__( 'onecomment_lang', '1 Comment');
  45.                             $morecomment    = j__( 'morecomment_lang', '% Comments');
  46.                             comments_number($zerocomment, $onecomment, $morecomment);
  47.                         ?>
  48.                     </a>
  49.                 </li>
  50.                 <?php } ?>
  51.                 <div class="clearboth"></div>
  52.             </ul>
  53.         </div>
  54.         <?php endif; ?>
  55.        
  56.         <div class="blog-container">
  57.             <?php          
  58.             if(is_single() || is_page() || $jdata->fullblog){
  59.                 if(has_category()) {
  60.                     $catlink = array();
  61.                     foreach(get_the_category() as $category) {
  62.                         $catlink[] = '<a href="' . get_category_link($category->term_id) . '" title="' . $category->description . '">' . $category->name . '</a>';
  63.                     }
  64.                     $catlink = implode(' , ', $catlink);                   
  65.                     printf(j__("filled_under_lang", 'jegtheme'), $catlink);
  66.                 }
  67.                
  68.                 the_content();
  69.                
  70.                 wp_link_pages( array( 'before' => '<div class="page-link">' . 'Pages : ', 'after' => '</div>' ) );
  71.                  
  72.                
  73.                
  74.             } else {
  75.                 $ismore = @strpos( $post->post_content, '<!--more-->');
  76.                
  77.                 if($ismore) {
  78.                     echo substr(the_content(), 0, $ismore);
  79.                 } else {
  80.                     the_excerpt();
  81.                 }
  82.             }?>
  83.         </div>
  84.        
  85.         <div class="bottom-bar">
  86.             <?php if(!is_single() && !is_page()): ?>
  87.             <div class="blog-more" style="float: left; margin-right : 10px;">
  88.                 <ul>
  89.                     <li>
  90.                         <a href="<?php the_permalink();?>" data-rel="tooltip" title="<?php j_e("more_detail");?>">
  91.                             <i class="misc-preview"></i>
  92.                         </a>                       
  93.                     </li>
  94.                 </ul>
  95.             </div>
  96.             <?php endif; ?>    
  97.             <div class="blog-like">
  98.                 <ul>
  99.                     <li>
  100.                         <a  target="_blank" href="<?php echo jShareToFacebook(get_permalink(), get_the_title()); ?>" data-rel="tooltip" title="<?php j_e("share_on_facebook_lang");?>"><i class="social-facebook"></i></a>
  101.                     </li>
  102.                     <li>
  103.                         <a target="_blank" href="<?php echo jShareToTwitter(get_permalink()); ?>" data-rel="tooltip" title="<?php j_e("share_on_twitter_lang");?>"><i class="social-twitter"></i></a>
  104.                     </li>
  105.                     <li>
  106.                         <a target="_blank" href="<?php echo jShareGoogle(get_permalink()); ?>" data-rel="tooltip" title="<?php j_e("share_on_google_lang", "Share on Google Plus");?>"><i class="social-gplust"></i></a>
  107.                     </li>
  108.                 </ul>
  109.                
  110.             </div>
  111.             <?php if(is_single() || $jdata->fullblog): ?>
  112.             <div class="postag">
  113.                 <?php the_tags('',''); ?>
  114.             </div>
  115.             <?php endif; ?>
  116.             <div class="clearbottombar"></div>
  117.         </div>
  118.        
  119.         <?php
  120.             if(is_single()){
  121.                 add_action('previous_post_link', 'j_prev_post');
  122.                 add_action('next_post_link', 'j_next_post');
  123.  
  124.                 function j_prev_post () {
  125.                     $post = get_adjacent_post( null, null , true );
  126.                     if ( ! $post ) {                       
  127.                         $output = "<a href='#' class='nolink'></a>";
  128.                     } else {
  129.                         $title = $post->post_title;
  130.                         $title = apply_filters( 'the_title', $title, $post->ID );                      
  131.                         $rel = $previous ? 'prev' : 'next';
  132.                        
  133.                         $output = '<a href="' . get_permalink( $post ) . '" rel="'.$rel.'">';
  134.                         $output = $output . "<span>" .  j__('prev_pos', 'Previous Post') . "</span>";
  135.                         $output = $output . "<strong>" .  $title . "</strong>";
  136.                         $output = $output . '</a>';
  137.                     }
  138.                     return $output;
  139.                 }
  140.                
  141.                 function j_next_post () {
  142.                     $post = get_adjacent_post( null, null , false );
  143.                     if ( ! $post ) {                       
  144.                         $output = "<a href='#' class='nolink'></a>";
  145.                     } else {
  146.                         $title = $post->post_title;
  147.                         $title = apply_filters( 'the_title', $title, $post->ID );                      
  148.                         $rel = $previous ? 'prev' : 'next';
  149.                        
  150.                         $output = '<a href="' . get_permalink( $post ) . '" rel="'.$rel.'">';
  151.                         $output = $output . "<span>" .  j__('next_pos', 'Next Post') . "</span>";
  152.                         $output = $output . "<strong>" .  $title . "</strong>";
  153.                         $output = $output . '</a>';
  154.                     }
  155.                     return $output;
  156.                 }
  157.         ?>
  158.         <div class="blog-next-prev">
  159.             <div class="blog-next">    
  160.                 <?php echo previous_post_link(); ?>
  161.             </div>
  162.             <div class="blog-prev">
  163.                 <?php echo next_post_link(); ?>
  164.             </div>
  165.         </div>
  166.         <?php
  167.             }
  168.         ?>
  169.        
  170.         <?php      
  171.             // overrided : comments-functions.php
  172.             if(isset($jdata->hideComment) && !$jdata->hideComment) {
  173.                 comments_template();
  174.             }
  175.         ?>
  176.        
  177.     </div>
  178. </div>
Advertisement
Add Comment
Please, Sign In to add comment