Guest User

Untitled

a guest
Jan 27th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.64 KB | None | 0 0
  1. <?php
  2. // Template Name: Portfolio-3-column
  3. /**
  4. * @Theme Name : wallstreet-Pro
  5. * @file : portfolio-2-column.php
  6. * @package : wallstreet-Pro
  7. @author : webriti
  8. * @filesource : wp-content/themes/wallstreet/portfolio-2-column.php
  9. */
  10. get_header(); ?>
  11. <script type="text/javascript">
  12. jQuery(document).ready(function()
  13. {
  14. jQuery("#mytabs li:eq(0)").addClass("active");
  15. var liactive= jQuery("#mytabs li.active a").attr("href");
  16. jQuery(liactive).addClass("active");
  17. });
  18. </script>
  19. <!-- Page Title Section -->
  20. <div class="page-mycarousel" style='background: url("<?php echo( get_header_image() ); ?>") repeat scroll center 0 #143745;'>
  21. <div class="page-title-col">
  22. <div class="container">
  23. <div class="row">
  24. <div class="page-header-title">
  25. <h1><?php the_title(); ?></h1>
  26. </div>
  27. </div>
  28. </div>
  29. <?php get_template_part('index', 'banner'); ?>
  30. </div>
  31. </div>
  32. <!-- /Page Title Section -->
  33. <?php $wallstreet_pro_options=theme_data_setup();
  34. $current_options = wp_parse_args( get_option( 'wallstreet_pro_options', array() ), $wallstreet_pro_options ); ?>
  35.  
  36. <div class="container">
  37. <div class="row">
  38. <div class="section_heading_title">
  39. <?php if($current_options['portfolio_title']) { ?>
  40. <h1><?php echo $current_options['portfolio_title']; ?></h1>
  41. <div class="pagetitle-separator">
  42. <div class="pagetitle-separator-border">
  43. <div class="pagetitle-separator-box"></div>
  44. </div>
  45. </div>
  46. <?php } ?>
  47. <?php if($current_options['portfolio_description']) { ?>
  48. <p><?php echo $current_options['portfolio_description']; ?></p>
  49. <?php } ?>
  50. </div>
  51. </div>
  52.  
  53. <!-- Category Filter Layer-->
  54. <div class="row">
  55.  
  56. <?php
  57. //for a given post type, return all
  58. $post_type = 'wallstreet_portfolio';
  59. $tax = 'portfolio_categories';
  60. $term_args=array( 'hide_empty' => true, 'orderby' => 'title','order' => 'DES',);
  61. $tax_terms = get_terms($tax, $term_args);
  62. $defualt_tex_id = get_option('wallstreet_webriti_default_term_id');
  63. ?>
  64.  
  65. <div class="col-md-12 portfolio-tabs-section">
  66. <ul class="portfolio-tabs" id="mytabs">
  67. <?php foreach ($tax_terms as $tax_term) {
  68. $tax_term_name = str_replace(' ', '_', $tax_term->name);
  69. $tax_term_name = preg_replace('~[^A-Za-z\d\s-]+~u', 'qua', $tax_term_name);
  70. ?>
  71. <li><a data-toggle="tab" href="#<?php echo $tax_term_name; ?>"><?php echo $tax_term->name; ?></a></li>
  72. <?php } ?>
  73. </ul>
  74. </div>
  75. </div><!-- /Category Filter Layer-->
  76.  
  77. <div id="myTabContent" class="tab-content main-portfolio-section">
  78. <?php $norecord=0;
  79. if ($tax_terms)
  80. { foreach ($tax_terms as $tax_term)
  81. { $count_posts = wp_count_posts( $post_type)->publish;
  82. $args = array (
  83. 'post_type' => $post_type,
  84. 'portfolio_categories' => $tax_term->slug,
  85. 'posts_per_page' =>$count_posts,
  86. 'orderby' => 'title',
  87. 'order' => 'ASC',
  88. 'post_status' => 'publish');
  89. $j=1;
  90. $portfolio_query = null;
  91. $portfolio_query = new WP_Query($args);
  92. if( $portfolio_query->have_posts() )
  93. {
  94. $tax_term_name = str_replace(' ', '_', $tax_term->name);
  95. $tax_term_name = preg_replace('~[^A-Za-z\d\s-]+~u', 'qua', $tax_term_name); ?>
  96. <div id="<?php echo $tax_term_name; ?>" class="tab-pane fade in">
  97. <div class="row">
  98. <?php while ($portfolio_query->have_posts()) : $portfolio_query->the_post(); ?>
  99. <?php if(get_post_meta( get_the_ID(),'meta_project_link', true ))
  100. { $meta_project_link=get_post_meta( get_the_ID(),'meta_project_link', true ); }
  101. else { $meta_project_link = get_post_permalink(); } ?>
  102. <div class="col-md-4 col-md-6 main-portfolio-area">
  103. <div class="main-portfolio-showcase">
  104. <div class="main-portfolio-showcase-media">
  105. <?php
  106. if(has_post_thumbnail())
  107. {
  108. $class=array('class'=>'img-responsive');
  109. the_post_thumbnail('', $class);
  110. $post_thumbnail_id = get_post_thumbnail_id();
  111. $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id );
  112. }
  113. else
  114. { ?>
  115. <img src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>images/portfolio/main-port1.jpg" class="img-responsive">
  116. <?php $post_thumbnail_url=WEBRITI_TEMPLATE_DIR_URI .'/images/portfolio/main-port1.jpg';
  117. } ?>
  118. <div class="main-portfolio-showcase-overlay">
  119. <div class="main-portfolio-showcase-overlay-inner">
  120. <div class="main-portfolio-showcase-detail">
  121. <h4><?php the_title();?></h4>
  122. <p><?php the_excerpt();?></p>
  123. <div class="portfolio-icon">
  124. <a <?php if(get_post_meta( get_the_ID(),'meta_project_target', true )) { echo "target='_blank'"; } ?> class="hover_thumb" title="<?php the_title(); ?>" data-lightbox="image" href="<?php echo $post_thumbnail_url; ?>" ><i class="fa fa-picture-o"></i></a>
  125. <a <?php if(get_post_meta( get_the_ID(),'meta_project_target', true )) { echo "target='_blank'"; } ?> href="<?php echo $meta_project_link; ?>"><i class="fa fa-link"></i></a>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. <?php if($j%3==0){ echo "<div class='clearfix'></div>"; } $j++;
  134. $norecord=1; endwhile; ?>
  135. </div>
  136. </div>
  137. <?php
  138. } /* end term wise data */ wp_reset_query();
  139. } // end for-each tax_terms
  140. } // end of text data
  141. ?>
  142. </div>
  143. </div>
  144. <?php if(!$norecord) { ?>
  145. <div class="container">
  146. <div class="row">
  147. <div class="wallstreet_page_heading" style="text-align:center;">
  148. <h3><?php _e('Opps! No Portfolio Found! Add Portfolio Using PORTFOLIO/PROJECT section.','wallstreet'); ?> </h3>
  149. </div>
  150. </div>
  151. </div>
  152. <?php } ?>
  153. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment