Advertisement
iasr

Responsive Gallery Page Template

Oct 14th, 2012
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.89 KB | None | 0 0
  1. <?php
  2. /**
  3. * The Template for displaying all single posts.
  4. *
  5. * @package WordPress
  6. * @subpackage Boilerplate
  7. * @since Boilerplate 1.0
  8. */
  9.  
  10. get_header(); ?>
  11.  
  12.  
  13. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  14. <?php $image_id = get_post_thumbnail_id(); ?>
  15. <?php $image_url = wp_get_attachment_image_src($image_id,'full'); ?>
  16. <div style="background-image: url(<?php echo $image_url[0]; ?>)" id="portbg">
  17. </div>
  18. <div id="overlay"></div>
  19.  
  20. <div class="wrap">
  21. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  22.  
  23. <div id="top">
  24.  
  25. <div id="breadcrumbs">
  26.  
  27. <a href="<?php bloginfo('url'); ?>/?page_id=78" class="home">home</a>
  28. <?php $category = get_the_category();
  29. if($category[0]){
  30. echo '<a href="#" class="current">'.$category[0]->cat_name.'</a>';
  31. }
  32. ?>
  33. </a>
  34.  
  35. </div>
  36.  
  37. <div id="share">
  38. <p>share this
  39. <a href="#"><img src="<?php bloginfo('stylesheet_directory'); ?>/img/fbshare.png"></a>
  40. <a href="#"><img src="<?php bloginfo('stylesheet_directory'); ?>/img/twshare.png"></a>
  41. </p>
  42. </div>
  43.  
  44. <h2><?php the_title(); ?></h2>
  45.  
  46. <h3><?php the_field('producing_company'); ?></h3>
  47.  
  48. </div>
  49.  
  50. <div id="mobtop">
  51.  
  52. <div id="mobportbg">
  53. <img src="<?php echo $image_url[0]; ?>" id="background">
  54.  
  55.  
  56. <div id="breadcrumbs">
  57.  
  58. <a href="#" class="home">home</a>
  59. <?php $category = get_the_category();
  60. if($category[0]){
  61. echo '<a href="#" class="current">'.$category[0]->cat_name.'</a>';
  62. }
  63. ?>
  64.  
  65. </div>
  66.  
  67. <div id="share">
  68. <p>share this
  69. <a href="#"><img src="<?php bloginfo('stylesheet_directory'); ?>/img/fbshare.png"></a>
  70. <a href="#"><img src="<?php bloginfo('stylesheet_directory'); ?>/img/twshare.png"></a>
  71. </p>
  72. </div>
  73.  
  74. <div id="mobshowtitle">
  75.  
  76. <h2><?php the_title(); ?></h2>
  77.  
  78. <h3><?php the_field('producing_company'); ?></h3>
  79.  
  80. </div>
  81.  
  82. </div>
  83.  
  84. </div>
  85.  
  86. <div id="intro"><?php the_field('intro/seo_text'); ?></div>
  87.  
  88. <!-- 'View Photos Link' <a href="#" class="button" id="view_port">view photos</a> -->
  89.  
  90. <?php if(get_field('gallery')): ?>
  91.  
  92. <ul id="fullport">
  93.  
  94. <?php while(the_repeater_field('gallery')): ?>
  95.  
  96. <?php $image = wp_get_attachment_image_src(get_sub_field('port_image'), 'full'); ?>
  97.  
  98. <?php $thumb = wp_get_attachment_image_src(get_sub_field('port_image'), 'thumbnail'); ?>
  99.  
  100. <li class="fullgallery">
  101.  
  102. <a href="<?php echo $image[0]; ?>" rel="lightbox[groupName]"><img src="<?php echo $thumb[0]; ?>" /></a>
  103.  
  104. </li>
  105.  
  106. <?php endwhile; ?>
  107.  
  108. <?php endif; ?>
  109.  
  110. <?php if( get_field('reviews-file') ): ?>
  111.  
  112. <?php while( has_sub_field('reviews-file') ): ?>
  113.  
  114. <li>
  115.  
  116. <a href="<?php the_sub_field('review_(.pdf)'); ?>" target="_blank">
  117.  
  118. <img src="<?php bloginfo('stylesheet_directory'); ?>/img/thumb-pdf.png">
  119.  
  120. </a>
  121.  
  122. </li>
  123.  
  124. <?php endwhile; ?>
  125.  
  126. <?php endif; ?>
  127.  
  128. <?php if( get_field('reviews-_from_external_site') ): ?>
  129.  
  130. <?php while( has_sub_field('reviews-_from_external_site') ): ?>
  131.  
  132. <li>
  133.  
  134. <a href="<?php the_sub_field('site_url'); ?>" target="_blank">
  135.  
  136. <img src="<?php bloginfo('stylesheet_directory'); ?>/img/thumb-www.png">
  137.  
  138. </a>
  139.  
  140. </li>
  141.  
  142. <?php endwhile; ?>
  143.  
  144. <?php endif; ?>
  145.  
  146. <?php if( get_field('videos') ): ?>
  147.  
  148. <?php while( has_sub_field('videos') ): ?>
  149.  
  150. <li>
  151.  
  152. <a href="<?php the_sub_field('video_url'); ?>" rel="lightbox[groupName]">
  153.  
  154. <img src="<?php bloginfo('stylesheet_directory'); ?>/img/thumb-video.png">
  155.  
  156. </a>
  157.  
  158. </li>
  159.  
  160. <?php endwhile; ?>
  161.  
  162. <?php endif; ?>
  163.  
  164. </ul>
  165.  
  166.  
  167. <?php if(get_field('gallery')): ?>
  168.  
  169. <ul id="port">
  170.  
  171. <?php while(the_repeater_field('gallery')): ?>
  172.  
  173. <?php $image = wp_get_attachment_image_src(get_sub_field('port_image'), 'full'); ?>
  174.  
  175. <?php $thumb = wp_get_attachment_image_src(get_sub_field('port_image'), 'thumbnail'); ?>
  176.  
  177. <li class="gallery">
  178.  
  179. <a href="<?php echo $image[0]; ?>"><img src="<?php echo $thumb[0]; ?>" /></a>
  180.  
  181. </li>
  182.  
  183. <?php endwhile; ?>
  184.  
  185. <?php endif; ?>
  186.  
  187. <?php if( get_field('reviews-file') ): ?>
  188.  
  189. <?php while( has_sub_field('reviews-file') ): ?>
  190.  
  191. <li>
  192.  
  193. <a href="<?php the_sub_field('review_(.pdf)'); ?>" target="_blank">
  194.  
  195. <img src="<?php bloginfo('stylesheet_directory'); ?>/img/thumb-pdf.png">
  196.  
  197. </a>
  198.  
  199. </li>
  200.  
  201. <?php endwhile; ?>
  202.  
  203. <?php endif; ?>
  204.  
  205. <?php if( get_field('reviews-_from_external_site') ): ?>
  206.  
  207. <?php while( has_sub_field('reviews-_from_external_site') ): ?>
  208.  
  209. <li>
  210.  
  211. <a href="<?php the_sub_field('site_url'); ?>" target="_blank">
  212.  
  213. <img src="<?php bloginfo('stylesheet_directory'); ?>/img/thumb-www.png">
  214.  
  215. </a>
  216.  
  217. </li>
  218.  
  219. <?php endwhile; ?>
  220.  
  221. <?php endif; ?>
  222.  
  223. <?php if( get_field('videos') ): ?>
  224.  
  225. <?php while( has_sub_field('videos') ): ?>
  226.  
  227. <li>
  228.  
  229. <a href="<?php the_sub_field('video_url'); ?>" data-ob="lightbox">
  230.  
  231. <img src="<?php bloginfo('stylesheet_directory'); ?>/img/thumb-video.png">
  232.  
  233. </a>
  234.  
  235. </li>
  236.  
  237. <?php endwhile; ?>
  238.  
  239. <?php endif; ?>
  240.  
  241. </ul>
  242.  
  243. <div id="breadcrumbsbottom">
  244.  
  245. <a href="#" class="home">home</a>
  246.  
  247. <?php $category = get_the_category();
  248. if($category[0]){
  249. echo '<a href="#" class="current">'.$category[0]->cat_name.'</a>';
  250. }
  251. ?>
  252.  
  253. </div>
  254.  
  255. </article><!-- #post-## -->
  256.  
  257.  
  258. <?php endwhile; // end of the loop. ?>
  259.  
  260. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement