single-jetpack-portfolio.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?php
  2. /**
  3. * Single portfolio template
  4. *
  5. * @package vamtam/consulting
  6. */
  7. if ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && 'XMLHttpRequest' === $_SERVER['HTTP_X_REQUESTED_WITH'] && have_posts() ) :
  8. the_post();
  9. if ( function_exists( 'sharing_add_header' ) ) {
  10. sharing_add_header();
  11. }
  12. FLBuilder::enqueue_layout_styles_scripts();
  13. extract( vamtam_get_portfolio_options() );
  14. ?>
  15. <h1 class="ajax-portfolio-title textcenter"><?php the_title() ?></h1>
  16. <article id="post-<?php the_ID(); ?>" <?php post_class( 'full ' . $type ); ?>>
  17. <div class="page-content">
  18. <?php include locate_template( 'single-jetpack-portfolio-content.php' ); ?>
  19. </div>
  20. </article>
  21. <?php
  22. if ( function_exists( 'sharing_add_footer' ) ) {
  23. sharing_add_footer();
  24. }
  25. print_late_styles();
  26. ?>
  27. <script> try { twttr.widgets.load(); } catch(e) {} </script>
  28. <?php
  29. exit;
  30. endif;
  31. get_header();
  32. ?>
  33. <div class="row page-wrapper">
  34. <?php VamtamTemplates::$in_page_wrapper = true; ?>
  35. <?php
  36. if ( have_posts() ) :
  37. while ( have_posts() ) : the_post();
  38. ?>
  39. <?php
  40. extract( vamtam_get_portfolio_options() );
  41. list( $terms_slug, $terms_name, $terms_id ) = vamtam_get_portfolio_terms();
  42. ?>
  43. <article id="post-<?php the_ID(); ?>" <?php post_class( VamtamTemplates::get_layout() . ' ' . $type ); ?>>
  44. <div class="page-content">
  45. <?php include locate_template( 'single-jetpack-portfolio-content.php' ); ?>
  46. <?php comments_template(); ?>
  47. </div>
  48. </article>
  49. <?php endwhile ?>
  50. <?php endif ?>
  51. <?php get_template_part( 'sidebar' ) ?>
  52. </div>
  53. <?php if ( ( rd_vamtam_get_optionb( 'show-related-portfolios' ) || is_customize_preview() ) && class_exists( 'VamtamProjectsModule' ) ) : ?>
  54. <?php if ( ! class_exists( 'Vamtam_Elements_B' ) || Vamtam_Elements_B::had_limit_wrapper() ) : ?>
  55. </div>
  56. <?php endif ?>
  57. <?php
  58. $related_query = new WP_Query( array(
  59. 'post_type' => Jetpack_Portfolio::CUSTOM_POST_TYPE,
  60. 'posts_per_page' => 1,
  61. 'post__not_in' => array( get_the_ID() ),
  62. 'tax_query' => array(
  63. array(
  64. 'taxonomy' => 'jetpack-portfolio-type',
  65. 'field' => 'id',
  66. 'terms' => $terms_id,
  67. ),
  68. ),
  69. ) );
  70. if ( intval( $related_query->found_posts ) > 0 ) :
  71. ?>
  72. <div class="related-portfolios row vamtam-related-content" <?php VamtamTemplates::display_none( rd_vamtam_get_optionb( 'show-related-portfolios' ) ) ?>>
  73. <div class="clearfix limit-wrapper vamtam-box-outer-padding">
  74. <?php echo wp_kses_post( apply_filters( 'vamtam_related_portfolios_title', '<h5 class="related-content-title">' . rd_vamtam_get_option( 'related-portfolios-title' ) . '</h5>' ) ); ?>
  75. <?php
  76. FLBuilder::render_module_html( 'vamtam-projects', array(
  77. 'column' => 4,
  78. 'tax_jetpack-portfolio-type' => implode( ',', $terms_id ),
  79. 'ids' => '',
  80. 'max' => 8,
  81. 'height' => 400,
  82. 'show_title' => 'below',
  83. 'description' => 'false',
  84. 'more' => esc_html__( 'View', 'vamtam-consulting' ),
  85. 'nopaging' => 'true',
  86. 'group' => 'true',
  87. 'layout' => 'scrollable',
  88. 'posts_jetpack-portfolio' => get_the_ID(),
  89. 'posts_jetpack-portfolio_matching' => 0,
  90. 'hover_animation' => 'hover-animation-2',
  91. ) );
  92. ?>
  93. </div>
  94. </div>
  95. <?php endif ?>
  96. <?php if ( ! class_exists( 'Vamtam_Elements_B' ) || Vamtam_Elements_B::had_limit_wrapper() ) : ?>
  97. <div class="limit-wrapper">
  98. <?php endif ?>
  99. <?php endif ?>
  100. <?php get_footer();