Advertisement
Guest User

single.php

a guest
Jan 23rd, 2014
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.11 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <?php $mts_options = get_option('point'); ?>
  3. <div id="page" class="single">
  4. <div class="content">
  5. <!-- Start Article -->
  6. <article class="article">
  7. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  8. <div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
  9. <div class="single_post">
  10. <header>
  11. <!-- Start Title -->
  12. <h1 class="title single-title"><?php the_title(); ?></h1>
  13. <!-- End Title -->
  14. <!-- Start Post Meta -->
  15. <div class="post-info"><span class="theauthor"><?php the_author_posts_link(); ?></span> | <span class="thetime"><?php the_time( get_option( 'date_format' ) ); ?></span> | <span class="thecategory"><?php the_category(', ') ?></span> | <span class="thecomment"><a href="<?php comments_link(); ?>"><?php comments_number();?></a></span></div>
  16. <!-- End Post Meta -->
  17. </header>
  18. <!-- Start Content -->
  19. <div class="post-single-content box mark-links">
  20. <?php if ($mts_options['mts_posttop_adcode'] != '') { ?>
  21. <?php $toptime = $mts_options['mts_posttop_adcode_time']; if (strcmp( date("Y-m-d", strtotime( "-$toptime day")), get_the_time("Y-m-d") ) >= 0) { ?>
  22. <div class="topad">
  23. <?php echo $mts_options['mts_posttop_adcode']; ?>
  24. </div>
  25. <?php } ?>
  26. <?php } ?>
  27. <?php the_content(); ?>
  28. <?php wp_link_pages(array('before' => '<div class="pagination">', 'after' => '</div>', 'link_before' => '<span class="current"><span class="currenttext">', 'link_after' => '</span></span>', 'next_or_number' => 'next_and_number', 'nextpagelink' => __('Next','mythemeshop'), 'previouspagelink' => __('Previous','mythemeshop'), 'pagelink' => '%','echo' => 1 )); ?>
  29. <?=function_exists('thumbs_rating_getlink') ? thumbs_rating_getlink() : ''?>
  30. <?php if ($mts_options['mts_postend_adcode'] != '') { ?>
  31. <?php $endtime = $mts_options['mts_postend_adcode_time']; if (strcmp( date("Y-m-d", strtotime( "-$endtime day")), get_the_time("Y-m-d") ) >= 0) { ?>
  32. <div class="bottomad">
  33. <?php echo $mts_options['mts_postend_adcode'];?>
  34. </div>
  35. <?php } ?>
  36. <?php } ?>
  37. <?php if($mts_options['mts_tags'] == '1') { ?>
  38. <!-- Start Tags -->
  39. <div class="tags"><?php the_tags('<span class="tagtext">'.__('Tags','mythemeshop').':</span>',', ') ?></div>
  40. <!-- End Tags -->
  41. <?php } ?>
  42. </div>
  43. <!-- End Content -->
  44. <?php if($mts_options['mts_related_posts'] == '1') { ?>
  45. <!-- Start Related Posts -->
  46. <?php $categories = get_the_category($post->ID); if ($categories) { $category_ids = array(); foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id; $args=array( 'category__in' => $category_ids, 'post__not_in' => array($post->ID), 'ignore_sticky_posts' => 1, 'showposts'=>4,'orderby' => 'rand' );
  47. $my_query = new wp_query( $args ); if( $my_query->have_posts() ) {
  48. echo '<div class="related-posts"><h3>'.__('Related Posts','mythemeshop').'</h3><div class="postauthor-top"><ul>';
  49. $pexcerpt=1; $j = 0; $counter = 0; while( $my_query->have_posts() ) { ++$counter; if($counter == 4) { $postclass = 'last'; $counter = 0; } else { $postclass = ''; } $my_query->the_post();?>
  50. <li class="<?php echo $postclass; ?> rpexcerpt<?php echo $pexcerpt ?> <?php echo (++$j % 2 == 0) ? 'last' : ''; ?>">
  51. <a rel="nofollow" class="relatedthumb" href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>">
  52. <span class="rthumb">
  53. <?php if(has_post_thumbnail()): ?>
  54. <?php the_post_thumbnail('widgetthumb', 'title='); ?>
  55. <?php else: ?>
  56. <img src="<?php echo get_template_directory_uri(); ?>/images/smallthumb.png" alt="<?php the_title(); ?>" class="wp-post-image" />
  57. <?php endif; ?>
  58. </span>
  59. <span>
  60. <?php the_title(); ?>
  61. </span>
  62. </a>
  63. <div class="meta">
  64. <a href="<?php comments_link(); ?>" rel="nofollow"><?php comments_number();?></a> | <span class="thetime"><?php the_time('M j, Y'); ?></span>
  65. </div> <!--end .entry-meta-->
  66. </li>
  67. <?php $pexcerpt++;?>
  68. <?php } echo '</ul></div></div>'; }} wp_reset_query(); ?>
  69. <!-- End Related Posts -->
  70. <?php }?>
  71. <?php if($mts_options['mts_author_box'] == '1') { ?>
  72. <!-- Start Author Box -->
  73. <div class="postauthor-container">
  74. <h4><?php _e('About The Author', 'mythemeshop'); ?></h4>
  75. <div class="postauthor">
  76. <?php if(function_exists('get_avatar')) { echo get_avatar( get_the_author_meta('email'), '100' ); } ?>
  77. <h5><?php the_author_meta( 'nickname' ); ?></h5>
  78. <p><?php the_author_meta('description') ?></p>
  79. </div>
  80. </div>
  81. <!-- End Author Box -->
  82. <?php }?>
  83. </div>
  84. </div>
  85. <?php comments_template( '', true ); ?>
  86. <?php endwhile; ?>
  87. </article>
  88. <!-- End Article -->
  89. <!-- Start Sidebar -->
  90. <?php get_sidebar(); ?>
  91. <!-- End Sidebar -->
  92. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement