Guest User

Untitled

a guest
Sep 10th, 2018
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.99 KB | None | 0 0
  1. <?php
  2. /**
  3. * @Theme Name : wallstreet-Pro
  4. * @file : index-portfolio.php
  5. * @package : wallstreet-Pro
  6. @author : webriti
  7. * @filesource : wp-content/themes/wallstreet/index-portfolio.php
  8. */
  9. ?>
  10. <!-- AddThis Button END -->
  11. <div class="portfolio-section">
  12. <div class="container">
  13. <?php $wallstreet_pro_options=theme_data_setup();
  14. $current_options = wp_parse_args( get_option( 'wallstreet_pro_options', array() ), $wallstreet_pro_options ); ?>
  15. <div class="row">
  16. <div class="section_heading_title">
  17. <?php if($current_options['portfolio_title']) { ?>
  18. <h1><?php echo $current_options['portfolio_title']; ?></h1>
  19. <div class="pagetitle-separator">
  20. <div class="pagetitle-separator-border">
  21. <div class="pagetitle-separator-box"></div>
  22. </div>
  23. </div>
  24. <?php } ?>
  25. <?php if($current_options['portfolio_description']) { ?>
  26. <p><?php echo $current_options['portfolio_description']; ?></p>
  27. <?php } ?>
  28. </div>
  29. </div>
  30. <div class="row">
  31. <?php
  32. $j=1;
  33. $total_portfolio = $current_options['portfolio_list'];
  34. $args = array( 'post_type' => 'wallstreet_portfolio','posts_per_page' =>$total_portfolio);
  35. $portfolio = new WP_Query( $args );
  36. if( $portfolio->have_posts() )
  37. { ?>
  38.  
  39. <?php while ($portfolio->have_posts()) : $portfolio->the_post(); ?>
  40. <?php if(get_post_meta( get_the_ID(),'meta_project_link', true ))
  41. { $meta_project_link=get_post_meta( get_the_ID(),'meta_project_link', true ); }
  42. else { $meta_project_link = get_post_permalink(); } ?>
  43. <div class="col-md-3 col-md-6 main-portfolio-area">
  44. <div class="main-portfolio-showcase">
  45. <div class="main-portfolio-showcase-media">
  46. <?php
  47. if(has_post_thumbnail())
  48. {
  49. $class=array('class'=>'img-responsive');
  50. the_post_thumbnail('', $class);
  51. $post_thumbnail_id = get_post_thumbnail_id();
  52. $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id );
  53. }
  54. else
  55. { ?>
  56. <img src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>images/portfolio/main-port1.jpg" class="img-responsive">
  57. <?php $post_thumbnail_url=WEBRITI_TEMPLATE_DIR_URI .'/images/portfolio/main-port1.jpg';
  58. } ?>
  59. <div class="main-portfolio-showcase-overlay">
  60. <div class="main-portfolio-showcase-overlay-inner">
  61. <div class="main-portfolio-showcase-detail">
  62. <h4><?php the_title();?></h4>
  63. <p><?php the_excerpt();?></p>
  64. <div class="portfolio-icon">
  65. <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>
  66. <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>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <?php if($j%4==0){ echo "<div class='clearfix'></div>"; } $j++;
  75. $norecord=1; endwhile; ?>
  76.  
  77.  
  78. <?php } else {
  79. for($i=1; $i<=4; $i++) { ?>
  80. <div class="col-md-3 col-md-6 home-portfolio-area">
  81. <div class="home-portfolio-showcase">
  82. <div class="home-portfolio-showcase-media">
  83. <img class="img-responsive" src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>/images/portfolio/port<?php echo $i; ?>.jpg" />
  84. <div class="home-portfolio-showcase-overlay">
  85. <div class="home-portfolio-showcase-overlay-inner">
  86. <div class="home-portfolio-showcase-detail">
  87. <h4><?php _e('Wallstreet style','wallstreet');?></h4>
  88. <p><?php _e('A wonderful serenity has taken possession of my entire soul, like these sweet mornings.','wallstreet'); ?></p>
  89. <div class="portfolio-btn"><a href="#"><?php _e('Read More','wallstreet'); ?></a></div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <?php } //end of default portfolio for loop ?>
  97. <div class="row">
  98. <div class="proejct-btn">
  99. <a target="<?php if($current_options['portfolio_more_lnik_target'] != false ){ echo '_blank'; } ?>" href="<?php echo $current_options['portfolio_more_link']; ?>"><?php printf( __('%s','wallstreet'),$current_options['portfolio_more_text']); ?> </a>
  100. </div>
  101. </div>
  102. <?php } ?>
  103. </div>
  104.  
  105. <?php
  106. if( $portfolio->have_posts() )
  107. {
  108. if($current_options['view_all_projects_btn_enabled']==true)
  109. {
  110. if($current_options['portfolio_more_text'])
  111. { ?>
  112. <div class ="row">
  113. <div class="proejct-btn">
  114. <a href="<?php if($current_options['portfolio_more_link'] !='') { echo $current_options['portfolio_more_link']; } ?>" <?php if($current_options['portfolio_more_lnik_target'] ==true) { echo "target='_blank'"; } ?>> <?php echo $current_options['portfolio_more_text']; ?> </a>
  115. </div>
  116. </div>
  117. <?php } } } ?>
  118. </div>
  119. </div>
  120. <!-- /wallstreet Portfolio Section ---->
Add Comment
Please, Sign In to add comment