Advertisement
Guest User

single post

a guest
Feb 10th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.37 KB | None | 0 0
  1. <?php
  2. /**
  3. * The main template file for display single post page.
  4. *
  5. * @package WordPress
  6. */
  7. $post_type = get_post_type();
  8.  
  9. if($post_type == 'gallery')
  10. {
  11. include (TEMPLATEPATH . "/gallery.php");
  12. exit;
  13. }
  14.  
  15. get_header();
  16.  
  17. ?>
  18. <br class="clear"/>
  19.  
  20. <!-- Begin content -->
  21. <div id="content_wrapper">
  22.  
  23. <div class="inner">
  24.  
  25. <!-- Begin main content -->
  26. <div class="inner_wrapper">
  27.  
  28. <div class="sidebar_content">
  29.  
  30. <?php
  31.  
  32. if (have_posts()) : while (have_posts()) : the_post();
  33.  
  34. ?>
  35.  
  36. <!-- Begin each blog post -->
  37. <div class="post_wrapper">
  38.  
  39. <div class="post_header_wrapper">
  40. <div class="post_header single_post">
  41. <h2><?php the_title(); ?></h2>
  42. </div>
  43. </div>
  44.  
  45. <br class="clear"/>
  46.  
  47. <div class="post_wrapper_inner">
  48. <div class="post_detail space half">
  49. <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/clock.png" class="middle"/>&nbsp;<?php echo get_the_time('d M Y'); ?>&nbsp;
  50. <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/author.png" class="middle"/>&nbsp;<?php echo _e( 'Posted by', THEMEDOMAIN ); ?> <?php echo get_the_author(); ?>
  51. <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/comment_alt2_stroke_14x16.png" class="middle"/>&nbsp;<?php comments_number('0 Comment', '1 Comment', '% Comments'); ?>
  52. </div>
  53. </div>
  54.  
  55. <?php
  56. if($post_type != 'reviews')
  57. {
  58. ?>
  59. <br class="clear"/>
  60. <?php
  61. }
  62. ?>
  63.  
  64. <div class="post_wrapper_inner">
  65.  
  66. <?php
  67. $pp_blog_single_img = get_option('pp_blog_single_img');
  68.  
  69. if(!empty($pp_blog_single_img) && $post_type != 'reviews')
  70. {
  71.  
  72. if(has_post_thumbnail(get_the_ID(), 'home_ft'))
  73. {
  74. $image_id = get_post_thumbnail_id(get_the_ID());
  75. $image_thumb = wp_get_attachment_image_src($image_id, 'home_ft', true);
  76. }
  77.  
  78. if(!empty($image_thumb))
  79. {
  80. ?>
  81.  
  82. <div class="post_img">
  83. <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
  84. <img src="<?php echo $image_thumb[0]; ?>" alt="" class=""/>
  85. </a>
  86. </div>
  87.  
  88. <?php
  89. }
  90. }
  91. ?>
  92.  
  93. <div class="post_inner_wrapper">
  94.  
  95. <?php
  96. $pp_enable_rating = get_option('pp_enable_rating');
  97.  
  98. if(!empty($pp_enable_rating) && $post_type != 'reviews')
  99. {
  100. echo do_shortcode('[ratings id="'.get_the_ID().'"]');
  101. ?>
  102. <br/>
  103. <?php
  104. }
  105. ?>
  106. <br class="clear"/>
  107. <?php
  108. the_content();
  109. ?>
  110.  
  111. </div>
  112.  
  113. </div>
  114. <!-- End each blog post -->
  115.  
  116. </div>
  117.  
  118. <br class="clear"/>
  119.  
  120. <div class="post_wrapper" style="margin-top:15px">
  121.  
  122. <div class="post_wrapper_inner">
  123.  
  124. <?php
  125. $pp_blog_display_social = get_option('pp_blog_display_social');
  126.  
  127. if(!empty($pp_blog_display_social)):
  128. ?>
  129. <ul class="social_media">
  130. <h5><?php _e( 'Share This', THEMEDOMAIN ); ?></h5><br/>
  131.  
  132. <li>
  133. <a target="_blank" href="http://twitter.com/home?status=<?php the_title()?> <?php the_permalink()?>" title="Retweet">
  134. <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_black/twitter.png" alt=""/>
  135. </a>
  136. </li>
  137. <li>
  138. <a target="_blank" href="http://digg.com/submit?url=<?php the_permalink()?>&title=<?php the_title()?>" title="Digg it">
  139. <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_black/digg.png" alt=""/>
  140. </a>
  141. </li>
  142. <li>
  143. <a target="_blank" href="http://www.facebook.com/share.php?u=<?php the_permalink()?>&t=<?php the_title()?>" title="social_black to Facebook">
  144. <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_black/facebook.png" alt=""/>
  145. </a>
  146. </li>
  147. <li>
  148. <a target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&bkmk=<?php the_permalink()?>&title=<?php the_title()?>&annotation=" title="Google Bookmark">
  149. <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_black/google.png" alt=""/>
  150. </a>
  151. </li>
  152. <li>
  153. <a target="_blank" href="<?php bloginfo('rss_url'); ?>" title="RSS">
  154. <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_black/rss.png" alt=""/>
  155. </a>
  156. </li>
  157. </ul>
  158. <?php
  159. endif; ?>
  160.  
  161. <?php
  162. $pp_blog_display_author = get_option('pp_blog_display_author');
  163.  
  164. if($pp_blog_display_author)
  165. {
  166. ?>
  167.  
  168. <br class="clear"/>
  169. <h5><?php _e( 'About The Author', THEMEDOMAIN ); ?></h5><br/>
  170.  
  171. <div id="about_the_author">
  172. <div class="thumb"><?php echo get_avatar( get_the_author_meta('email'), '50' ); ?></div>
  173. <div class="description">
  174. <strong><?php the_author_posts_link(); ?></strong><br/>
  175. <?php the_author_meta('description'); ?>
  176. </div>
  177. </div><br class="clear"/>
  178.  
  179. <?php
  180. }
  181. ?>
  182.  
  183. <?php
  184. $pp_blog_display_related = get_option('pp_blog_display_related');
  185.  
  186. if($pp_blog_display_related)
  187. {
  188. ?>
  189.  
  190. <?php
  191. //for use in the loop, list 5 post titles related to first tag on current post
  192. $tags = wp_get_post_tags($post->ID);
  193. if ($tags) {
  194. $first_tag = $tags[0]->term_id;
  195. $args=array(
  196. 'tag__in' => array($first_tag),
  197. 'post__not_in' => array($post->ID),
  198. 'showposts'=>3,
  199. 'caller_get_posts'=>1
  200. );
  201. $my_query = new WP_Query($args);
  202. if( $my_query->have_posts() ) {
  203. echo '<br class="clear"/><h5>Related Posts</h5><br class="clear"/>';
  204. ?>
  205.  
  206. <div class="related_posts">
  207.  
  208. <?php
  209. global $have_related;
  210. while ($my_query->have_posts()) : $my_query->the_post();
  211. $have_related = TRUE;
  212. ?>
  213. <div class="each_item">
  214. <?php
  215. if(has_post_thumbnail($post->ID, 'related_post'))
  216. {
  217. $image_id = get_post_thumbnail_id($post->ID);
  218. $image_url = wp_get_attachment_image_src($image_id, 'related_post', true);
  219. ?>
  220. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php echo $image_url[0]; ?>" alt="" class="frame"/>
  221. </a><br/>
  222. <?php
  223. }
  224. ?>
  225. <div class="content">
  226. <strong class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></strong>
  227. <br/>
  228. <span class="post_attribute"><?php echo get_the_time('F j, Y', $post->ID); ?></span>
  229. </div>
  230. </div>
  231. <?php
  232. endwhile;
  233.  
  234. wp_reset_query();
  235. ?>
  236. </div>
  237. <br class="clear"/>
  238. <?php
  239. }
  240. }
  241. ?>
  242.  
  243. <?php
  244. } //end if show related
  245. ?>
  246.  
  247. <?php comments_template( '' ); ?>
  248. <?php comment_form(); ?>
  249. <br class="clear"/>
  250.  
  251.  
  252. <?php wp_link_pages(); endwhile; endif; ?>
  253.  
  254. </div>
  255.  
  256. </div>
  257.  
  258. </div>
  259.  
  260. <div class="sidebar_wrapper">
  261. <div class="sidebar">
  262.  
  263. <div class="content">
  264.  
  265. <ul class="sidebar_widget">
  266. <?php dynamic_sidebar('Single Post Sidebar'); ?>
  267. </ul>
  268.  
  269. </div>
  270.  
  271. </div>
  272. <br class="clear"/>
  273.  
  274. <div class="sidebar_bottom"></div>
  275. </div>
  276.  
  277. </div>
  278. <!-- End main content -->
  279.  
  280. <br class="clear"/>
  281. </div>
  282.  
  283. <div class="bottom"></div>
  284.  
  285. </div>
  286. <!-- End content -->
  287.  
  288.  
  289.  
  290. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement