darshan_saroya

home-portfolio.php

Feb 19th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.21 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. <!-- New Portfolio -->
  23. <div class="container-fluid bottom-pad margin-top100">
  24.     <div class="container">
  25.         <div class="row portfolio-content">
  26.             <div class="col-md-12 portfolio-title text-center"><?php
  27.                     if(($wl_theme_options['home_port_title']!="") || ($wl_theme_options['home_port_description']!="")){ ?>
  28.                 <h2 class="wow bounceIn"><?php echo esc_attr($wl_theme_options['home_port_title']); ?></h2>
  29.                 <h4 class="wow fadeInRight"><?php echo esc_attr($wl_theme_options['home_port_description']); ?></h4>
  30.                 <?php } ?>
  31.             </div>
  32.             <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 portfolio-<?php echo esc_attr($portfolio_layout); ?>-column wow bounceIn">
  33.                     <div class="grid"><?php
  34.                         $args = array('post_type'=>'creative_portfolio','posts_per_page' =>$count_portfolio);
  35.                         $f_query = new WP_Query($args);
  36.                         if($f_query->have_posts()){
  37.                         $i=1;
  38.                             while($f_query->have_posts()) { $f_query->the_post();
  39.                             if(get_post_meta( get_the_ID(), 'port_button_link', true )) {
  40.                             $link = esc_url(get_post_meta( get_the_ID(), 'port_button_link', true )); }else{
  41.                                 $link= get_the_permalink();
  42.                             }                           ?>
  43.                                 <!-- Item 1 -->
  44.                             <?php
  45.                                     if(has_post_thumbnail()){
  46.                                     $defalt_arg =array('class' => "creative-img-responsive");
  47.                                     $port_thumbnail_id = get_post_thumbnail_id();
  48.                                     $large_image_url = wp_get_attachment_url($port_thumbnail_id);
  49.                                     ?>
  50.                                     <div class="col-md-<?php echo $column; ?> col-sm-6 port-pics">
  51.                                     <div class="img-thumbnail">
  52.                                    
  53.                                     <?php
  54.                                         if($count==2){
  55.                                             the_post_thumbnail('port_2_thumb',$defalt_arg);
  56.                                         }else if($count==3){
  57.                                             the_post_thumbnail('port_3_thumb',$defalt_arg);
  58.                                         }else if($count==4){
  59.                                             the_post_thumbnail('port_4_thumb',$defalt_arg);
  60.                                         }
  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 the_permalink(); ?>"><?php the_title(); ?></a>
  65.                                         <span>
  66.                                             <a href="<?php echo $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