Advertisement
deliciousthemes

Sympathique - single-portfolio.php

Oct 11th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.05 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <?php
  3. $portfolio_slide = get_post_meta($post->ID,'dt_slider_repeat',true);
  4.  
  5. $portf_more_images = get_post_meta($post->ID, 'dt_more_images_block', true);
  6. ?>
  7.  
  8. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  9.  
  10. <?php get_template_part( 'includes/subheader' ); ?>
  11.  
  12. <div class="centered-wrapper">
  13. <section class="portfolio-single">
  14. <article id="post-<?php the_ID(); ?>" class="begin-content">
  15. <?php
  16. if(!empty($portfolio_slide)) { ?>
  17. <div id="container-slides">
  18. <div id="slides">
  19. <div class="slides_container">
  20.  
  21. <?php
  22. $title = get_the_title();
  23. $new_title = strtolower(str_replace(' ', '-', $title));
  24. $i=1;
  25.  
  26. foreach ($portfolio_slide as $slide){ ?>
  27. <div class="slide">
  28. <?php $image = $slide['dt_image_field_id'];
  29. $video = $slide['dt_video_field_id'];
  30.  
  31. if (!empty($video)) {
  32. echo $video;
  33. }
  34.  
  35. if (empty($video)) {
  36. echo '<a rel="prettyPhoto[pp_gal]" href="'.esc_url($image['url']).'"><img src="'.esc_url($image['url']).'" alt="'.$new_title.'-image-'.$i.'" /></a>';
  37. $i++; }
  38. ?>
  39. </div>
  40.  
  41. <?php
  42. }
  43. ?>
  44.  
  45. </div><!--end slides_container-->
  46. <?php if((!empty($i)) && ($i > 2)) { ?>
  47. <a href="#" class="prev"><img src="<?php echo get_template_directory_uri(); ?>/images/blog-arrow-prev.png" width="24" height="43" alt="Arrow Prev"></a>
  48. <a href="#" class="next"><img src="<?php echo get_template_directory_uri(); ?>/images/blog-arrow-next.png" width="24" height="43" alt="Arrow Next"></a>
  49. <?php } ?>
  50. </div><!--end slides-->
  51. </div><!--end container-slides-->
  52.  
  53. <span class="masonry-post-meta">
  54. <?php
  55. $categories = get_the_terms(get_the_ID(), 'portfolio_cats');
  56. $separator = ' / ';
  57. $output = '';
  58. if($categories){
  59. foreach($categories as $category) {
  60. if (function_exists('icl_t')) {
  61. $output .= '<a href="'.get_term_link( $category->slug, 'portfolio_cats' ).'" title="' . esc_attr( sprintf( __( "View all posts in %s", 'delicious' ), $category->name ) ) . '">'.icl_t('Portfolio Category', 'Term '.get_taxonomy_cat_ID( $category->name ).'', $category->name).'</a>'.$separator;
  62. }
  63. else {
  64. $output .= '<a href="'.get_term_link( $category->slug, 'portfolio_cats' ).'" title="' . esc_attr( sprintf( __( "View all posts in %s", 'delicious' ), $category->name ) ) . '">'.$category->name.'</a>'.$separator;
  65. }
  66. }
  67. echo trim($output, $separator);
  68. }
  69. ?>
  70. </span>
  71.  
  72. <?php } ?>
  73.  
  74. <div class="clear"></div>
  75.  
  76. <?php the_content(); ?>
  77.  
  78. <?php if(!empty($portf_more_images)) { ?>
  79. <div class="space"></div>
  80.  
  81. <div class="bgtitle"><h2><?php _e('PROJECT PHOTOS', 'delicious'); ?></h2></div>
  82.  
  83.  
  84. <div class="portfolio-gallery">
  85. <?php
  86. foreach ($portf_more_images as $single_image) {
  87. $extra_image = $single_image['dt_portfolio_extra_image'];
  88. $extra_image_name = $single_image['dt_portfolio_extra_image_name'];
  89. $extra_image_desc = $single_image['dt_portfolio_extra_image_desc'];
  90.  
  91. $small_image = aq_resize($extra_image['url'], 360, 9999, false);
  92. ?>
  93. <a title="<?php echo esc_attr($extra_image_desc); ?>" href="<?php echo esc_url($extra_image['url']); ?>" rel="prettyPhoto[pp_gal]">
  94. <span class="item-on-hover"><span class="hover-image"></span></span>
  95. <img alt="<?php echo esc_attr($extra_image_name); ?>" src="<?php echo esc_url($small_image); ?>" />
  96. </a>
  97. <?php
  98. }
  99. ?>
  100. </div>
  101. <?php } ?>
  102.  
  103. <?php
  104. $p_related_items = get_post_meta($post->ID, 'dt_related_portf_items');
  105. if (!empty($p_related_items)) { get_template_part( 'includes/related-portfolio-posts'); } ?>
  106. </article>
  107. </section>
  108.  
  109. <div class="clear"></div>
  110.  
  111. </div><!--end centered-wrapper-->
  112. <?php endwhile; endif; ?>
  113.  
  114. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement