Advertisement
smith_d88

Untitled

Apr 11th, 2011
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.50 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Portfolio
  4. */
  5. get_header();
  6.  
  7.  
  8. global $kriesi_options;
  9. ?>
  10.  
  11. <div id="content">
  12. <div id="inner_content_big">
  13. <?php if (have_posts()) : while (have_posts()) : the_post();
  14. $punchline = get_post_meta($post->ID, "punchline", true);
  15. ?>
  16. <span class="meta"><?php echo $punchline; ?></span>
  17. <h2 id="post-<?php the_ID(); ?>"><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>
  18. </div>
  19.  
  20.  
  21. <?php endwhile; endif;
  22.  
  23. $more = 0;
  24. $posts_per_page = $k_options['portfolio']['portfolio_entry_count'];
  25. $query_string ="posts_per_page=".$k_options['portfolio']['portfolio_entry_count'];
  26. $query_string .= "&cat=".$k_options['portfolio']['slider_port_final']."&paged=$paged";
  27. query_posts($query_string);
  28. $boxnumber = 1;
  29. if (have_posts()) : while (have_posts()) : the_post();
  30. $portfolio_image = get_post_meta($post->ID, "portfolio-image", true);
  31. $portfolio_image_small= get_post_meta($post->ID, "portfolio-image-small", true);
  32.  
  33. if($portfolio_image != "" && $k_options['general']['tim'] == 1)
  34. {
  35. $resizepath = get_bloginfo('template_url')."/timthumb.php?src="; #timthumb path
  36. $resize_options1 = "&amp;w=250&amp;h=132&amp;zc=1";
  37.  
  38. $portfolio_image_small = $resizepath.$portfolio_image.$resize_options1;
  39. }
  40.  
  41. if($portfolio_image_small != ""){
  42.  
  43. if ($boxnumber == 1) echo '<div class="entry_portfolio">'; ?>
  44.  
  45. <div class="small_box box<?php echo $boxnumber; ?>">
  46. <div class="portfolio_item">
  47. <h3 id="post-<?php the_ID(); ?>"><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>
  48. <?php
  49. echo '<a href="'.get_post_meta($post->ID, 'url', true).'" rel="lightbox[portfolio]"><img class="aligncenter" src="'.$portfolio_image_small.'" alt="" /></a>';
  50.  
  51. ?>
  52. </div><!--end portfolio_item-->
  53. <?php the_excerpt(); ?>
  54. </div><!--end small_box-->
  55. <?php if ($boxnumber == 3) echo '</div>'; ?>
  56. <?php
  57. $boxnumber = $boxnumber == 3 ? '1' : $boxnumber + 1;
  58. }
  59. endwhile;
  60. echo"<div class='inner_content portfolio_inner_content'>";
  61. kriesi_pagination($query_string);
  62. echo'</div>';
  63. else: ?>
  64. <div class="entry">
  65. <h2>Nothing Found</h2>
  66. <p>Sorry, no posts matched your criteria.</p>
  67. </div>
  68.  
  69. <!--do not delete-->
  70. <?php endif;
  71. if($boxnumber != 1){
  72. echo '</div>';
  73. }
  74.  
  75.  
  76. #start of portfolio content boxes
  77. $runs = 3;
  78.  
  79. for($counter = 1; $counter <= $runs; $counter++)
  80. {
  81. switch($k_options['portfolio']['box'.$counter.'_content'])
  82. {
  83. case 'post':
  84. $query_string = "&showposts=1";
  85. $offset = 0;
  86. #calculate offset
  87. if($counter > 1)
  88. {
  89. for($i = 1; $i < $counter; $i++)
  90. {
  91. if($k_options['portfolio']['box'.$i.'_content'] == $k_options['portfolio']['box'.$counter.'_content'])
  92. {
  93. if($k_options['portfolio']['box'.$i.'_content_post'] == $k_options['portfolio']['box'.$counter.'_content_post'] )
  94. {
  95. $offset++;
  96. }
  97. }
  98. }
  99. }
  100.  
  101. $query_string .= "&offset=".$offset.".&cat=".$k_options['portfolio']['box'.$counter.'_content_post'];
  102. query_posts($query_string);
  103.  
  104. if (have_posts()) :
  105. while (have_posts()) : the_post();
  106. $punchline = get_post_meta($post->ID, "punchline", true);
  107. $link = get_permalink();
  108. $more = 0;
  109.  
  110.  
  111. echo'<div class="small_box box'.$counter.'">'."\n";
  112. echo'<span class="meta">'.$punchline.'</span>'."\n";
  113. echo'<h3><a href="'.$link.'">'.get_the_title().'</a></h3>'."\n";
  114. the_content('read more &raquo;');
  115. echo'</div><!--end widget-->'."\n";
  116. endwhile;
  117. endif;
  118. break;
  119.  
  120. case 'page':
  121. $query_string = "page_id=".$k_options['portfolio']['box'.$counter.'_content_page'];
  122. query_posts($query_string);
  123.  
  124. if (have_posts()) :
  125. while (have_posts()) : the_post();
  126. $punchline = get_post_meta($post->ID, "punchline", true);
  127. $link = get_permalink();
  128. $more = 0;
  129.  
  130.  
  131. echo'<div class="small_box box'.$counter.'">'."\n";
  132. echo'<span class="meta">'.$punchline.'</span>'."\n";
  133. echo'<h3><a href="'.$link.'">'.get_the_title().'</a></h3>'."\n";
  134. the_content('read more &raquo;');
  135. echo'</div><!--end widget-->'."\n";
  136. endwhile;
  137. endif;
  138.  
  139. break;
  140.  
  141. case 'widget':
  142. if (function_exists('dynamic_sidebar') && dynamic_sidebar('Portfolio Box'.$counter)){}
  143. break;
  144. default:
  145. apply_placeholder($counter);
  146. }
  147. }
  148.  
  149. function apply_placeholder($column)
  150. {
  151. $themeurl = get_bloginfo('template_url');
  152.  
  153. if($column == 1)
  154. {
  155. echo '
  156. <div class="small_box box1">
  157. <h3><a href="#">Software that works</a></h3>
  158. <p>Our software works perfectly on every system and is coded with the latest standards in mind.</p><p>It is easy to use and very customizable, and our support is top-notch :)</p><img class="ie6fix" alt="" src="'.$themeurl.'/files/front5.png"/>
  159. </div>';
  160. }
  161.  
  162. if($column == 2)
  163. {
  164. echo'
  165. <div class="small_box box2">
  166. <h3><a href="#">We build for every system</a></h3>
  167. <p>Our workpieces are made to operate on Windows, Linux and Mac OSX in every single browser you can imagine.</p>
  168. <p>Be sure to get a quote if you are interested in getting one of our products.</p>
  169. <img class="ie6fix" alt="" src="'.$themeurl.'/files/front2.png"/>
  170. </div>';
  171. }
  172.  
  173. if($column == 3)
  174. {
  175. echo'
  176. <div class="small_box box3">
  177. <h3><a href="#">Contact</a></h3>
  178. <p>If you are interested in using my service feel free to contact me.</p><p>For your convenience I have included a contact form on my contact page.</p><img class="ie6fix" alt="" src="'.$themeurl.'/files/front4.png"/>
  179. </div>';
  180. }
  181. }
  182.  
  183.  
  184. ?>
  185.  
  186.  
  187.  
  188.  
  189. </div><!-- end content-->
  190. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement