Advertisement
Guest User

custom post type1

a guest
Apr 17th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.05 KB | None | 0 0
  1. <?php
  2. /**
  3. Template Name: IceCream
  4. * @file page.php
  5.  
  6. */
  7. ?>
  8. <?php get_header(); ?>
  9.  
  10. <div class="row">
  11. <div class="span12">
  12.  
  13. <div id="content">
  14. <!-- Add breadcrumb -->
  15. <?php if(of_get_option('breadcrumbs', '1')) {?>
  16. <?php echo responsive_breadcrumb_lists(); ?>
  17. <?php } ?>
  18. <!-- end breadcrumb -->
  19. <?php $btn_color = 'btn-'.of_get_option('p_btn_color', '' );
  20. $btn_size = 'btn-'.of_get_option('p_btn_size', '' );
  21. ?>
  22.  
  23. <?php if(of_get_option('filter_btns', '1')) {?>
  24. <?php
  25. $terms = get_terms("ictag");
  26. $count = count($terms);
  27. $fbtn_color = 'btn-'.of_get_option('f_btn_color', '' );
  28. $fbtn_size = 'btn-'.of_get_option('f_btn_size', '' );
  29. echo '<div id="portfolio-filter" class="btn-group" data-toggle="buttons-radio">';
  30. echo '<a class="btn '.$fbtn_color.' '.$fbtn_size.' active" href="#all" data-filter="*" title="">All</a>';
  31. if ( $count > 0 ){
  32.  
  33. foreach ( $terms as $term ) {
  34.  
  35. $termname = strtolower($term->name);
  36. $termname = str_replace(' ', '-', $termname);
  37. echo '<a data-filter=".'.$termname.'" class="btn '.$fbtn_color.' '.$fbtn_size.'" href="#'.$termname.'" title="" rel="'.$termname.'">'.$term->name.'</a>';
  38. }
  39. }
  40. echo "</div>";
  41. ?>
  42. <?php } ?>
  43.  
  44. <?php
  45. // get portfolio column count
  46. $portfolio_count = of_get_option('portfolio_column', 'three' );
  47. if ( $portfolio_count == "two") {
  48. $pcount = '6';
  49. } elseif ($portfolio_count == "three") {
  50. $pcount = '4';
  51. } elseif ($portfolio_count == "four") {
  52. $pcount = '3';
  53. }
  54. ?>
  55. <?php
  56. // added posts to show alphabetically
  57. $loop = new WP_Query(array('post_type' => 'icecream', 'order' => 'ASC', 'orderby' => 'title', 'posts_per_page' => -1));
  58. $count =0;
  59. ?>
  60.  
  61. <div id="portfolio-wrapper portfolio-<?php echo $portfolio_count ?>-column">
  62. <ul id="portfolio-list" class="thumbnails">
  63.  
  64. <?php if ( $loop ) :
  65.  
  66. while ( $loop->have_posts() ) : $loop->the_post(); ?>
  67.  
  68. <?php
  69. $terms = get_the_terms( $post->ID, 'ictag' );
  70.  
  71. if ( $terms && ! is_wp_error( $terms ) ) :
  72. $links = array();
  73.  
  74. foreach ( $terms as $term )
  75. {
  76. $links[] = $term->name;
  77. }
  78. $links = str_replace(' ', '-', $links);
  79. $tax = join( " ", $links );
  80. else :
  81. $tax = '';
  82. endif;
  83. ?>
  84.  
  85. <?php
  86.  
  87. ?>
  88.  
  89. <!--THIS BEGINS MY POST BOX, INCLUDING TITLE AND CONTENT OF POST -->
  90.  
  91. <li class="span<?php echo ($pcount); ?> <?php echo strtolower($tax); ?> block">
  92. <div class="menu-container">
  93. <!-- Removed permalink to post title -->
  94. <?php if(of_get_option('project_title', '1')) {?>
  95. <!-- Removed permalink to post title -->
  96. <div class="menu-item-title"><?php the_title(); ?>
  97. <!-- Removed permalink to post title END -->
  98. <div class="item-desc"><?php the_content(__('responsive')); ?><div class="favorite-box"><div class="favorite"><?php wpfp_link() ?></div></div></div>
  99. </div><?php } ?>
  100. <?php if(of_get_option('project_btns', '1')) {?>
  101. <?php
  102. $btn_color = 'btn-'.of_get_option('p_btn_color', '' );
  103. $btn_size = 'btn-'.of_get_option('p_btn_size', '' );
  104. if(of_get_option('p_button_block', '1')) {
  105. $btn_block = "btn-block";
  106. }
  107. ?>
  108. <?php } ?>
  109. </div></li>
  110.  
  111. <!--THIS ENDS MY POST BOX, INCLUDING TITLE AND CONTENT OF POST -->
  112. <?php endwhile; else: ?>
  113.  
  114. <li class="error-not-found">Sorry, no portfolio entries for while.</li>
  115.  
  116. <?php endif; ?>
  117.  
  118. </ul>
  119.  
  120. <div class="clearboth"></div>
  121.  
  122. </div> <!-- end #portfolio-wrapper-->
  123.  
  124. </div><!-- end of #content -->
  125. </div><!-- end of span12 -->
  126. </div><!-- end of row -->
  127.  
  128. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement