Guest User

Untitled

a guest
Mar 30th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.59 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. { while ( $portfolio->have_posts() ) : $portfolio->the_post();
  38. if(get_post_meta( get_the_ID(),'meta_project_link', true ))
  39. { $meta_project_link=get_post_meta( get_the_ID(),'meta_project_link', true ); }
  40. else { $meta_project_link = get_post_permalink(); }
  41. ?>
  42. <div class="col-md-4 col-md-6 home-portfolio-area">
  43. <div class="home-portfolio-showcase">
  44. <div class="home-portfolio-showcase-media">
  45. <?php
  46. $defalt_arg =array('class' => "img-responsive");
  47. if(has_post_thumbnail()):
  48. the_post_thumbnail('',$defalt_arg);
  49. $post_thumbnail_id = get_post_thumbnail_id();
  50. $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id );
  51. ?>
  52. <div class="home-portfolio-showcase-overlay">
  53. <div class="home-portfolio-showcase-overlay-inner">
  54. <div class="home-portfolio-showcase-detail">
  55. <h4><?php the_title(); ?></h4>
  56. <p><?php the_excerpt();?></p>
  57. <?php if(get_post_meta( get_the_ID(),'portfolio_project_button_text', true ) ) { ?>
  58. <div class="portfolio-btn"><a href="<?php echo $meta_project_link; ?>" <?php if(get_post_meta( get_the_ID(),'meta_project_target', true )) { echo "target='_blank'"; } ?>><?php echo get_post_meta( get_the_ID(),'portfolio_project_button_text', true ); ?></a>
  59. </div>
  60. <?php } ?>
  61. </div>
  62. </div>
  63. </div>
  64. <?php endif; ?>
  65. </div>
  66. </div>
  67. </div>
  68. <?php if($j%3==0){ echo "<div class='clearfix'></div>"; } $j++; endwhile;
  69. } else {
  70. for($i=1; $i<=4; $i++) { ?>
  71. <div class="col-md-3 col-md-6 home-portfolio-area">
  72. <div class="home-portfolio-showcase">
  73. <div class="home-portfolio-showcase-media">
  74. <img class="img-responsive" src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>/images/portfolio/port<?php echo $i; ?>.jpg" />
  75. <div class="home-portfolio-showcase-overlay">
  76. <div class="home-portfolio-showcase-overlay-inner">
  77. <div class="home-portfolio-showcase-detail">
  78. <h4><?php _e('Wall Street Style','wallstreet');?></h4>
  79. <p><?php _e('A wonderful serenity has taken possession of my entire soul, like these sweet mornings.','wallstreet'); ?></p>
  80. <div class="portfolio-btn"><a href="#"><?php _e('Read more','wallstreet'); ?></a></div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <?php } //end of default portfolio for loop ?>
  88. <div class="row"><div class="proejct-btn">
  89. <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>
  90. </div></div>
  91. <?php } ?>
  92. </div>
  93.  
  94. <?php
  95. if( $portfolio->have_posts() )
  96. {
  97. if($current_options['view_all_projects_btn_enabled']=='on')
  98. {
  99. if($current_options['portfolio_more_text'])
  100. { ?>
  101. <div class ="row">
  102. <div class="proejct-btn">
  103. <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>
  104. </div>
  105. </div>
  106. <?php } } } ?>
  107. </div>
  108. </div>
  109. <!-- /wallstreet Portfolio Section ---->
Add Comment
Please, Sign In to add comment