Guest User

Untitled

a guest
May 21st, 2020
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.94 KB | None | 0 0
  1. <?php spicepress_before_portfolio_section_trigger(); ?>
  2. <?php
  3. $portfolio_section_enable = get_theme_mod('portfolio_section_enable','on');
  4. if($portfolio_section_enable !='off')
  5. {
  6. $portfolio_animation_speed = get_theme_mod('portfolio_animation_speed', 3000);
  7. $isRTL = (is_rtl()) ? (bool) true : (bool) false;
  8. $projectsettings=array('animationSpeed'=>$portfolio_animation_speed,'rtl'=>$isRTL);
  9.  
  10.  
  11. wp_register_script('spicepress-project',get_template_directory_uri().'/js/front-page/project.js',array('jquery'));
  12. wp_localize_script('spicepress-project','portfolio_settings',$projectsettings);
  13. wp_enqueue_script('spicepress-project');
  14.  
  15. ?>
  16. <!-- Portfolio Section -->
  17. <section class="portfolio-section">
  18. <div class="container">
  19. <?php
  20. $home_portfolio_section_title = get_theme_mod('home_portfolio_section_title',__('Our Portfolio','spicepress'));
  21. $home_portfolio_section_discription = get_theme_mod('home_portfolio_section_discription','Sea summo mazim ex, ea errem eleifend definitionem vim. Ut nec hinc dolor possim mei ludus efficiendi ei sea summo mazim ex.');
  22. ?>
  23. <!-- Section Title -->
  24. <div class="row">
  25. <div class="col-md-12">
  26. <div class="section-header">
  27. <h1 class="widget-title wow fadeInUp animated animated" data-wow-duration="500ms" data-wow-delay="0ms"><?php echo $home_portfolio_section_title; ?></h1>
  28. <div class="widget-separator"><span></span></div>
  29. <p class="wow fadeInDown animated"><?php echo $home_portfolio_section_discription; ?></p>
  30. </div>
  31. </div>
  32. </div>
  33. <!-- /Section Title -->
  34.  
  35. <!-- Item Scroll -->
  36. <div class="wow fadeInUp animated row" data-wow-delay="100ms" data-wow-duration="300ms">
  37. <div class="row">
  38. <div id="portfolio-carousel" class="owl-carousel owl-theme col-md-12 horizontal-nav">
  39. <?php
  40. $post_type = 'spicepress_portfolio';
  41.  
  42. $args = array (
  43. 'post_type' => $post_type,
  44. 'tax_query' => array(
  45. array(
  46. 'taxonomy' => 'portfolio_categories',
  47. 'field' => 'id',
  48. 'terms' => get_theme_mod('portfolio_selected_category_id', 2),
  49. //'operator' => 'NOT IN',
  50. ),
  51. ),
  52. //'posts_per_page' => $project_setting['portfolio_list'],
  53. 'post_status' => 'publish');
  54. $j=1;
  55. $portfolio_query = null;
  56. $portfolio_query = new WP_Query($args);
  57. if( $portfolio_query->have_posts() )
  58. {
  59. while ($portfolio_query->have_posts()) : $portfolio_query->the_post();
  60. $portfolio_title_description =sanitize_text_field( get_post_meta( get_the_ID(), 'portfolio_title_description', true ));
  61. $portfolio_link =esc_url( get_post_meta( get_the_ID(), 'portfolio_link', true ));
  62. $portfolio_target = sanitize_text_field( get_post_meta( get_the_ID(), 'portfolio_target', true ));
  63. ?>
  64.  
  65. <div class="item">
  66. <article class="post">
  67. <figure class="post-thumbnail">
  68. <?php
  69. if(has_post_thumbnail())
  70. {
  71. $class=array('class'=>'img-responsive'); ?>
  72. <?php if(!empty($portfolio_link)) {?>
  73. <a href="<?php echo $portfolio_link;?>" <?php if(!empty($portfolio_target)){ echo 'target="_blank"'; } ?> class="hover_thumb">
  74.  
  75. <?php the_post_thumbnail('', $class); ?>
  76.  
  77. <?php }
  78. $post_thumbnail_id = get_post_thumbnail_id();
  79. $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id );
  80. }
  81. ?>
  82. <div class="thumbnail-showcase-overlay">
  83. <div class="thumbnail-showcase-icons">
  84. <?php if(isset($post_thumbnail_url)){ ?>
  85. <a href="<?php echo $post_thumbnail_url; ?>" data-lightbox="image" title="<?php the_title(); ?>" class="hover_thumb"><i class="fa fa-picture-o"></i></a>
  86. <?php } ?>
  87. <?php if(!empty($portfolio_link)) {?>
  88. <a href="<?php echo $portfolio_link;?>" <?php if(!empty($portfolio_target)){ echo 'target="_blank"'; } ?> class="hover_thumb"><i class="fa fa-link"></i></a>
  89. <?php } ?>
  90. </div>
  91. </div>
  92. </figure>
  93. <header class="entry-header">
  94. <h4 class="entry-title"><?php if(!empty($portfolio_link)) {?>
  95. <a href="<?php echo $portfolio_link;?>" <?php if(!empty($portfolio_target)){ echo 'target="_blank"'; } ?> class="hover_thumb"><?php the_title(); ?></a>
  96. <?php } else the_title(); ?>
  97. </h4>
  98. </header>
  99. <?php if(get_post_meta( get_the_ID(),'portfolio_title_description', true ))
  100. { ?>
  101. <div class="entry-content">
  102. <p><?php echo get_post_meta( get_the_ID(),'portfolio_title_description', true ); ?></p>
  103. </div>
  104. <?php } ?>
  105. </article>
  106. </div>
  107. <?php $j++; endwhile; } ?>
  108. </div>
  109. </div>
  110. </div>
  111. <!-- /Item Scroll -->
  112. </div>
  113. </section>
  114. <!-- /Portfolio Section -->
  115. <?php } ?>
  116. <?php spicepress_after_portfolio_section_trigger(); ?>
Add Comment
Please, Sign In to add comment