Advertisement
DavidEllzey

single.php

Nov 10th, 2011
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.03 KB | None | 0 0
  1. <?php
  2. /**
  3. * The main template file for display single post page.
  4. *
  5. * @package WordPress
  6. * @subpackage Link
  7. */
  8.  
  9.  
  10. get_header();
  11.  
  12. $page_sidebar = 'Blog Sidebar';
  13. $caption_class = "page_caption";
  14.  
  15. ?>
  16. <!-- Begin content -->
  17. <div id="content_wrapper" class="cat_width">
  18.  
  19. <br class="clear"/>
  20.  
  21. <div class="inner">
  22.  
  23. <!-- Begin main content -->
  24. <div class="inner_wrapper">
  25.  
  26. <div class="sidebar_content">
  27.  
  28. <?php
  29.  
  30. if (have_posts()) : while (have_posts()) : the_post();
  31.  
  32. ?>
  33.  
  34. <!-- Begin each blog post -->
  35. <div class="post_wrapper">
  36. <div class="post_header">
  37. <h4 class="cufon single black">
  38. <?php the_title(); ?>
  39. </h4>
  40. <div class="post_attribute">
  41. Posted by:&nbsp;<?php the_author(); ?>&nbsp;&nbsp;&nbsp;
  42. Tags:&nbsp;
  43. <?php the_tags(''); ?>&nbsp;&nbsp;&nbsp;
  44. Posted date:&nbsp;
  45. <?php the_time('F j, Y'); ?> <?php edit_post_link('edit post', ', ', ''); ?>
  46. &nbsp;|&nbsp;
  47. <?php comments_number('No comment', 'Comment', '% Comments'); ?>
  48. </div>
  49. </div>
  50.  
  51. <?php
  52. if(has_post_thumbnail(get_the_ID(), 'large'))
  53. {
  54. $image_id = get_post_thumbnail_id(get_the_ID());
  55. $image_url = wp_get_attachment_image_src($image_id, 'large', true);
  56.  
  57. $pp_blog_image_width = get_option('pp_blog_image_width');
  58. if(empty($pp_blog_image_width))
  59. {
  60. $pp_blog_image_width = 550;
  61. }
  62. $pp_blog_image_height = get_option('pp_blog_image_height');
  63. if(empty($pp_blog_image_height))
  64. {
  65. $pp_blog_image_height = 200;
  66. }
  67. ?>
  68. <br class="clear"/><br/>
  69.  
  70. <div class="post_img">
  71. <img src="<?php echo get_bloginfo( 'stylesheet_directory' ); ?>/timthumb.php?src=<?php echo $image_url[0]; ?>&w=<?php echo $pp_blog_image_width; ?>&h=<?php echo $pp_blog_image_height; ?>&zc=1" alt="" class="frame"/>
  72. </div>
  73. <?php
  74. }
  75. ?>
  76.  
  77. <br class="clear"/>
  78.  
  79. <?php echo the_content(); ?>
  80.  
  81. <?php
  82. $pp_blog_display_share = get_option('pp_blog_display_share');
  83.  
  84. if($pp_blog_display_share)
  85. {
  86. ?>
  87.  
  88. <ul class="social_media">
  89. <h5 class="cufon"><span>Share This</span></h5>
  90.  
  91. <li>
  92. <a href="http://twitter.com/home?status=<?php the_title(); ?> <?php the_permalink(); ?>" title="Retweet">
  93. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/twitter_32.png" alt=""/>
  94. </a>
  95. </li>
  96. <li>
  97. <a href="http://delicious.com/post?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" title="Delicious">
  98. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/delicious_32.png" alt=""/>
  99. </a>
  100. </li>
  101. <li>
  102. <a href="http://digg.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" title="Digg it">
  103. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/digg_32.png" alt=""/>
  104. </a>
  105. </li>
  106. <li>
  107. <a href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>&t=<?php the_title(); ?>" title="Share to Facebook">
  108. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/facebook_32.png" alt=""/>
  109. </a>
  110. </li>
  111. <li>
  112. <a href="http://posterous.com/share?linkto=<?php the_permalink(); ?>&title=<?php the_title(); ?>" title="Posterous">
  113. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/posterous_32.png" alt=""/>
  114. </a>
  115. </li>
  116. <li>
  117. <a href="http://www.mixx.com/submit?page_url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" title="Mixx">
  118. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/mixx_32.png" alt=""/>
  119. </a>
  120. </li>
  121. <li>
  122. <a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" title="Stumbleupon">
  123. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/stumbleupon_32.png" alt=""/>
  124. </a>
  125. </li>
  126. <li>
  127. <a href="mailto:?body=&subject=<?php the_title(); ?>" title="Email this">
  128. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/email_32.png" alt=""/>
  129. </a>
  130. </li>
  131. <li>
  132. <a href="http://www.tumblr.com/share?u=<?php the_permalink(); ?>&t=<?php the_title(); ?>" title="Tumblr">
  133. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/tumblr_32.png" alt=""/>
  134. </a>
  135. </li>
  136. <li>
  137. <a href="http://reporter.nl.msn.com/?fn=contribute&URL=<?php the_permalink(); ?>&Title=<?php the_title(); ?>" title="MSN">
  138. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/windows_32.png" alt=""/>
  139. </a>
  140. </li>
  141. <li>
  142. <a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=<?php the_permalink(); ?>&title=<?php the_title(); ?>&annotation=" title="Google Bookmark">
  143. <img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/share/google_32.png" alt=""/>
  144. </a>
  145. </li>
  146. </ul>
  147.  
  148. <?php
  149. } //end if show share this
  150. ?>
  151.  
  152. </div>
  153. <!-- End each blog post -->
  154.  
  155. <div class="post_wrapper">
  156.  
  157. <?php
  158. $pp_blog_display_author = get_option('pp_blog_display_author');
  159.  
  160. if($pp_blog_display_author)
  161. {
  162. ?>
  163. <br class="clear"/>
  164.  
  165. <h5 class="cufon"><span>About the author</span></h5>
  166.  
  167. <div id="about_the_author">
  168. <div class="thumb"><?php echo get_avatar( get_the_author_meta('email'), '50' ); ?></div>
  169. <div class="description">
  170. <strong><?php the_author_link(); ?></strong><br/>
  171. <?php the_author_meta('description'); ?>
  172. </div>
  173. </div>
  174.  
  175. <?php
  176. }
  177. ?>
  178.  
  179. <?php
  180. $pp_blog_display_related = get_option('pp_blog_display_related');
  181.  
  182. if($pp_blog_display_related)
  183. {
  184. ?>
  185.  
  186. <?php
  187. //for use in the loop, list 5 post titles related to first tag on current post
  188. $tags = wp_get_post_tags($post->ID);
  189. if ($tags) {
  190. $first_tag = $tags[0]->term_id;
  191. $args=array(
  192. 'tag__in' => array($first_tag),
  193. 'post__not_in' => array($post->ID),
  194. 'showposts'=>3,
  195. 'caller_get_posts'=>1
  196. );
  197. $my_query = new WP_Query($args);
  198. if( $my_query->have_posts() ) {
  199. echo '<br class="clear"/><br/><br/><h5 class="cufon"><span>Related Posts</span></h5><br class="clear"/>';
  200. ?>
  201.  
  202. <div class="related_posts">
  203.  
  204. <?php
  205. global $have_related;
  206. while ($my_query->have_posts()) : $my_query->the_post();
  207. $have_related = TRUE;
  208. ?>
  209.  
  210. <?php
  211. if(has_post_thumbnail($post->ID, 'large'))
  212. {
  213. $image_id = get_post_thumbnail_id($post->ID);
  214. $image_url = wp_get_attachment_image_src($image_id, 'large', true);
  215. ?>
  216. <a href="<?php the_permalink() ?>" rel="bookmark" class="alignleft" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php bloginfo( 'stylesheet_directory' ); ?>/timthumb.php?src=<?php echo $image_url[0]; ?>&h=100&w=165&zc=1" alt="" class="frame"/>
  217. </a>
  218. <?php
  219. }
  220. ?>
  221.  
  222. <div class="related_post_desc left">
  223. <strong class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></strong>
  224. <br/>
  225. <span class="post_attribute"><?php echo get_the_time('F j, Y', $post->ID); ?></span>
  226. <br/><br/>
  227. <?php echo pp_substr(strip_tags(strip_shortcodes($post->post_content)), 120); ?>
  228. </div>
  229.  
  230. <br class="clear"/><br/>
  231.  
  232. <?php
  233. endwhile;
  234.  
  235. wp_reset_query();
  236. ?>
  237. </div>
  238. <?php
  239. }
  240. }
  241. ?>
  242.  
  243. <?php
  244. } //end if show related
  245. ?>
  246.  
  247. <?php comments_template( '' ); ?>
  248.  
  249.  
  250. <?php wp_link_pages(); endwhile; endif; ?>
  251.  
  252. </div>
  253.  
  254. </div>
  255.  
  256. <div class="sidebar_wrapper">
  257. <br class="clear"/>
  258.  
  259. <div class="sidebar">
  260.  
  261. <div class="content">
  262.  
  263. <ul class="sidebar_widget">
  264. <?php dynamic_sidebar($page_sidebar); ?>
  265. </ul>
  266.  
  267. </div>
  268.  
  269. </div>
  270. <br class="clear"/>
  271.  
  272. <div class="sidebar_bottom"></div>
  273. </div>
  274.  
  275. </div>
  276. <!-- End main content -->
  277.  
  278. <br class="clear"/>
  279. </div>
  280.  
  281. <div class="bottom"></div>
  282.  
  283. </div>
  284. <!-- End content -->
  285.  
  286.  
  287.  
  288. <?php get_footer(); ?>
  289.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement