Guest User

home-portfolio.php

a guest
Jun 6th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.24 KB | None | 0 0
  1. <!-- Portfolio Work -->
  2. <?php $wl_theme_options = weblizar_portfolio_options();
  3. $portfolio_layout = $wl_theme_options['portfolio_layout'];
  4. //var_dump($portfolio_layout); die;
  5. $column =3;
  6. if($portfolio_layout=="two") {
  7. $count=2;
  8. $column =6;
  9. $count_portfolio = $count*2;
  10. }
  11. if($portfolio_layout=="three") {
  12. $count=3;
  13. $count_portfolio = $count*2;
  14. $column =4;
  15. }
  16. if($portfolio_layout=="four") {
  17. $count=4;
  18. $count_portfolio = $count*2;
  19. $column =3;
  20. }
  21. ?>
  22.  
  23. <!-- New Portfolio -->
  24. <div class="container-fluid bottom-pad margin-top100">
  25. <div class="container">
  26. <div class="row portfolio-content">
  27. <div class="col-md-12 portfolio-title text-center"><?php
  28. if(($wl_theme_options['home_port_title']!="") || ($wl_theme_options['home_port_description']!="")){ ?>
  29. <h2 class="wow bounceIn"><?php echo esc_attr($wl_theme_options['home_port_title']); ?></h2>
  30. <h4 class="wow fadeInRight"><?php echo esc_attr($wl_theme_options['home_port_description']); ?></h4>
  31. <?php } ?>
  32. </div>
  33. <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 portfolio-<?php echo esc_attr($portfolio_layout); ?>-column wow bounceIn">
  34. <div class="grid"><?php
  35. $args = array('post_type'=>'creative_portfolio','posts_per_page' =>$count_portfolio);
  36. $f_query = new WP_Query($args);
  37. if($f_query->have_posts()){
  38. $i=1;
  39. while($f_query->have_posts()) { $f_query->the_post(); ?>
  40. <!-- Item 1 -->
  41. <?php
  42. if(has_post_thumbnail()){
  43. $defalt_arg =array('class' => "creative-img-responsive");
  44. $port_thumbnail_id = get_post_thumbnail_id();
  45. $large_image_url = wp_get_attachment_url($port_thumbnail_id);
  46. ?>
  47. <div class="col-md-<?php echo $column; ?> col-sm-6 port-pics">
  48. <div class="img-thumbnail">
  49.  
  50. <?php
  51. if($count==2){
  52. the_post_thumbnail('port_2_thumb',$defalt_arg);
  53. }else if($count==3){
  54. the_post_thumbnail('port_3_thumb',$defalt_arg);
  55. }else if($count==4){
  56. the_post_thumbnail('port_4_thumb',$defalt_arg);
  57. }
  58. if(get_post_meta( get_the_ID(),'port_button_link', true ) !='')
  59. { $port_button_link=get_post_meta( get_the_ID(),'port_button_link', true ); }
  60. else { $port_button_link = get_post_permalink(); }
  61. ?>
  62. <div class="overlay colom<?php echo $count; ?>">
  63. <p><?php echo wp_trim_words(get_the_content(),10,null); ?></p>
  64. <h4><a href="<?php echo $port_button_link; ?>"><?php the_title(); ?></a>
  65. <span>
  66. <a href="<?php echo $port_button_link; ?>"><i class="fa fa-paperclip icon"></i></a>
  67. <a href="<?php echo esc_url($large_image_url); ?>" class="photobox_a"><i class="fa fa-eye icon"></i></a>
  68. </span>
  69. </h4>
  70. </div>
  71. </div>
  72. </div>
  73. <?php } ?><?php
  74. }
  75. }else { for($i=1; $i<=6; $i++) { ?>
  76. <div class="col-md-<?php echo $column; ?> col-sm-6 port-pics">
  77. <div class="img-thumbnail">
  78. <img src="<?php echo esc_url(get_template_directory_uri()); ?>/img/portfolio/01.jpg" class="img-responsive" alt="" />
  79. <div class="overlay colom<?php echo $count; ?>">
  80. <p><?php _e('Lorem Ipsum is simply dummy text of the printing and typesetting industry.', 'creative'); ?></p>
  81. <h4><a href="#"><?php _e('Marchant Mogal','creative'); ?></a>
  82. <span>
  83. <a href=""><i class="fa fa-paperclip icon"></i></a>
  84. <a href="<?php echo esc_url(get_template_directory_uri()); ?>/img/portfolio/01.jpg" class="photobox_a"><i class="fa fa-eye icon"></i></a>
  85. </span>
  86. </h4>
  87. </div>
  88. </div>
  89. </div>
  90. <?php
  91. //if($i%3==0){ echo '<div class="clearfix"></div>'; }
  92. }
  93. } ?>
  94. </div>
  95. <!-- /grid -->
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. <!-- New Portfolio -->
  101.  
  102.  
  103. <!-- /Portfolio work -->
Add Comment
Please, Sign In to add comment