Guest User

Untitled

a guest
Mar 22nd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.72 KB | None | 0 0
  1. <?php the_post(); ?>
  2. <div class="container">
  3. <div id="project_description">
  4. <?php echo the_content(); ?>
  5. </div>
  6. </div>
  7.  
  8. <?php
  9. $post_type = 'appoint_portfolio';
  10. $tax = 'portfolio_categories';
  11. $term_args=array( 'hide_empty' => true,'orderby' => 'id');
  12. $tax_terms = get_terms($tax, $term_args);
  13. $defualt_tex_id = get_option('appointment_webriti_default_term_id');
  14. $j=1;
  15. $tab= get_option('tab');
  16. if(isset($_GET['div']))
  17. {
  18. $tab=$_GET['div'];
  19. }
  20. ?>
  21.  
  22. <div class="page-builder">
  23.  
  24. <div class="container">
  25.  
  26. <div class="row">
  27. <div class="col-md-12">
  28. <div class="portfolio-tabs-section">
  29. <ul id="mytabs" class="portfolio-tabs">
  30. <?php foreach ($tax_terms as $tax_term) {
  31. ?>
  32. <li class="tab <?php if($tab==''){if($j==1){echo 'active';$j=2;}}else if($tab==$tax_term->slug){echo 'active';}?>"><a id="tab" href="#<?php echo $tax_term->slug; ?>" data-toggle="tab"><?php echo $tax_term->name; ?></a></li>
  33. <?php } ?>
  34. </ul>
  35. </div>
  36. </div>
  37. </div><!-- .row -->
  38.  
  39. <div class="tab-content main-portfolio-section" id="">
  40.  
  41. <?php
  42. global $paged;
  43. $curpage = $paged ? $paged : 1;
  44.  
  45. $norecord=0;
  46. $total_posts=0;
  47. $min_post_start=0;
  48. $is_active=true;
  49.  
  50. if ($tax_terms)
  51. {
  52. foreach ($tax_terms as $tax_term)
  53. {
  54. if(isset($_POST['total_posts']))
  55. {
  56. $count_posts = $_POST['total_posts'];
  57. }
  58. else
  59. {
  60. //$count_posts = wp_count_posts( $post_type)->publish;
  61. if(is_page_template('portfolio-2-col.php')) {$count_posts = 4;}
  62. if(is_page_template('portfolio-3-col.php')) {$count_posts = 6;}
  63. if(is_page_template('portfolio-4-col.php')) {$count_posts = 8;}
  64.  
  65. }
  66.  
  67. if(isset($_POST['min_post_start']))
  68. {
  69. $min_post_start = $_POST['min_post_start'];
  70. }
  71.  
  72. $total_posts=$count_posts;
  73.  
  74. $args = array (
  75. 'max_num_pages' =>5,
  76. 'post_status' => 'publish',
  77. 'post_type' => $post_type,
  78. 'portfolio_categories' => $tax_term->slug,
  79. 'posts_per_page' =>$count_posts,
  80. 'paged' => $curpage,
  81. );
  82.  
  83. global $j;
  84. $j=1;
  85. $portfolio_query = null;
  86. $portfolio_query = new WP_Query($args);
  87.  
  88. if( $portfolio_query->have_posts() ):
  89.  
  90. ?>
  91.  
  92. <div id="<?php echo $tax_term->slug; ?>" class="tab-pane fade in <?php if($tab==''){if($is_active==true){echo 'active';}$is_active=false;}else if($tab==$tax_term->slug){echo 'active';} ?>">
  93.  
  94.  
  95. <div class="row">
  96.  
  97. <?php while ($portfolio_query->have_posts()) : $portfolio_query->the_post(); ?>
  98.  
  99. <?php
  100.  
  101. $project_link_chkbx = sanitize_text_field( get_post_meta( get_the_ID(), 'project_link_chkbx', true ));
  102.  
  103. if(get_post_meta( get_the_ID(),'project_more_btn_link', true )) {
  104. $project_more_btn_link = get_post_meta( get_the_ID(),'project_more_btn_link', true );
  105. }
  106. else
  107. {
  108. $project_more_btn_link = '';
  109. }
  110.  
  111. $class = '';
  112.  
  113. if(is_page_template('portfolio-2-col.php')) {
  114. $class = 'col-md-6 col-md-6 portfolio-area';
  115. }
  116.  
  117. if(is_page_template('portfolio-3-col.php')) {
  118. $class = 'col-md-4 col-md-6 portfolio-area';
  119. }
  120.  
  121. if(is_page_template('portfolio-4-col.php')) {
  122. $class = 'col-md-3 col-md-6 portfolio-area';
  123. }
  124.  
  125. echo '<div class="'.$class.'">';
  126. ?>
  127.  
  128. <div class="portfolio-image">
  129. <?php if(is_page_template('portfolio-2-col.php')) {
  130. appointment_image_thumbnail('','img-responsive');
  131. } ?>
  132.  
  133. <?php if(is_page_template('portfolio-3-col.php')) {
  134. appointment_image_thumbnail('','img-responsive');
  135. } ?>
  136.  
  137. <?php if(is_page_template('portfolio-4-col.php')) {
  138. appointment_image_thumbnail('','img-responsive');
  139. } ?>
  140.  
  141. <?php
  142. if(has_post_thumbnail())
  143. {
  144. $post_thumbnail_id = get_post_thumbnail_id();
  145. $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id );
  146. }
  147. ?>
  148. <div class="portfolio-showcase-overlay">
  149.  
  150. <div class="portfolio-showcase-overlay-inner">
  151.  
  152. <div class="portfolio-showcase-icons">
  153.  
  154. <?php if(isset($post_thumbnail_url)){ ?>
  155. <a href="<?php echo $post_thumbnail_url; ?>" data-lightbox="image" title="<?php the_title(); ?>" class="hover_thumb"><i class="fa fa-search"></i></a>
  156. <?php } ?>
  157. <?php if(!empty($project_more_btn_link)) {?>
  158. <a href="<?php echo $project_more_btn_link;?>" <?php if(!empty($project_link_chkbx)){ echo 'target="_blank"'; } ?> title="Appointment" class="hover_thumb"><i class="fa fa-plus"></i></a>
  159. <?php } ?>
  160.  
  161. </div>
  162.  
  163. </div>
  164.  
  165. </div>
  166.  
  167. </div><!-- .portfolio-image -->
  168.  
  169. <div class="portfolio-caption">
  170.  
  171. <h4><?php if(!empty($project_more_btn_link)) {?>
  172. <a href="<?php echo $project_more_btn_link;?>" <?php if(!empty($project_link_chkbx)){ echo 'target="_blank"'; } ?> class="hover_thumb"><?php the_title(); ?></a>
  173. <?php } else the_title(); ?></h4>
  174. <?php if(get_post_meta( get_the_ID(), 'project_description', true )){ ?>
  175. <p><?php echo get_post_meta( get_the_ID(), 'project_description', true ); ?></p>
  176. <?php } ?>
  177.  
  178. </div><!-- .portfolio-caption -->
  179.  
  180. <?php echo '</div>'; ?>
  181.  
  182. <?php
  183. // call clearfix css class
  184. appointment_portfolio_clearfix($j);
  185.  
  186. $norecord=1;
  187. ?>
  188.  
  189. <?php endwhile; ?>
  190.  
  191. <?php
  192.  
  193. $count_posts_2c = wp_count_posts('appoint_portfolio')->publish;
  194.  
  195. if($count_posts_2c > 4) {
  196. $Webriti_pagination = new Webriti_pagination();
  197. $Webriti_pagination->Webriti_page($curpage, $portfolio_query);
  198. }
  199. else if($count_posts_2c > 6)
  200. {
  201. $Webriti_pagination = new Webriti_pagination();
  202. $Webriti_pagination->Webriti_page($curpage, $portfolio_query);
  203. }
  204. else if($count_posts_2c > 8)
  205. {
  206. $Webriti_pagination = new Webriti_pagination();
  207. $Webriti_pagination->Webriti_page($curpage, $portfolio_query);
  208. }
  209. ?>
  210.  
  211.  
  212. </div>
  213.  
  214. </div>
  215.  
  216. <?php
  217.  
  218. wp_reset_query();
  219.  
  220. else:
  221.  
  222. ?>
  223. <div id="<?php echo $tax_term->slug; ?>" class="tab-pane fade in <?php if($tab==''){if($is_active==true){echo 'active';}$is_active=false;}else if($tab==$tax_term->slug){echo 'active';} ?>"></div>
  224. <?php
  225.  
  226. endif;
  227.  
  228.  
  229. }
  230. }
  231. ?>
  232.  
  233. </div><!-- .tab-content -->
  234.  
  235. </div><!-- .container -->
  236.  
  237. </div><!-- .page-builder -->
  238.  
  239. <!-- /Portfolio Section -->
  240. <?php get_template_part('index', 'testimonial'); ?>
  241.  
  242. <script type="text/javascript">
  243. jQuery('.tab').click(function(e) {
  244. e.preventDefault();
  245. var h = jQuery("a",this).attr('href').replace(/#/, "");
  246. jQuery.ajax({
  247. url: "",
  248. type: "POST",
  249. data: { code : h },
  250. dataType: "html"
  251. });
  252. });
  253.  
  254. </script>
  255.  
  256.  
  257.  
  258. <?php
  259.  
  260. if(isset($_POST['code'])){
  261.  
  262. $code = $_POST['code'];
  263. update_option('tab',$code);
  264.  
  265. }
  266.  
  267. get_footer();
Add Comment
Please, Sign In to add comment