Guest User

Untitled

a guest
Nov 16th, 2013
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: imagesGallery
  4. */
  5. ?>
  6.  
  7. <?php get_header(); ?>
  8. <div class="container">
  9. <div class="row">
  10.  
  11. <?php if( have_posts() ): ?>
  12. <?php while ( have_posts() ) : the_post();
  13.  
  14. if( function_exists('dfi_get_featured_images') ) {
  15. $featuredImages = dfi_get_featured_images();
  16.  
  17. //Loop through the image to display your image
  18.  
  19. if( !is_null($featuredImages) ){
  20.  
  21. $links = array();
  22.  
  23. foreach($featuredImages as $images){
  24. $thumb = $images['thumb'];
  25. $fullImage = $images['full'];
  26.  
  27. $links[] = "<a href='{$fullImage}' class='dfiImageLink'><img src='{$thumb}' /></a>";
  28. }
  29.  
  30. echo "<div class='dfiImages'>";
  31. foreach($links as $link){
  32. echo $link;
  33. }
  34. echo "</div>";
  35. }
  36. }
  37.  
  38. ?>
  39. <?php the_content(); ?>
  40. <?php endwhile; ?>
  41. <?php endif; ?>
  42. <?php wp_reset_postdata(); wp_reset_query(); ?>
  43.  
  44. <?php $ccfit_loop = new WP_Query( array( 'post_type' => 'photo', 'posts_per_page' => 9999 ) ); ?>
  45.  
  46. <?php if ( $ccfit_loop->have_posts() ) : ?>
  47. <?php while ( $ccfit_loop->have_posts() ) : $ccfit_loop->the_post(); ?>
  48.  
  49. <?php
  50. $ccfit_img_thumb = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_id() ), 'ccfit_thumb', false );
  51. $ccfit_img_big = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_id() ), 'ccfit_big', false );
  52.  
  53. echo '
  54. <div class="col-md-4">
  55. <div class="inner">
  56. <a href="'. $ccfit_img_big[0] .'"></a>
  57. <img src="'. $ccfit_img_thumb[0] .'">
  58. <h2>'. get_the_title() .'</h2>
  59. <p>'. get_the_content() .'</p>
  60. <hr>
  61. <?php
  62. if (isset($featuredImages) && is_array($featuredImages)) {
  63. foreach($featuredImages as $images) {
  64. $thumb = $images['thumb'], <------------------- line 64
  65. $fullImage = $images['full'],
  66. print ' <a class="fancybox" href="'. $fullImage .'" style="text-align:center">&laquo; Take a look &raquo;</a> ';
  67. }
  68. }
  69. ?>
  70. </div></div>'; ?>
  71.  
  72. <?php endwhile; ?>
  73. <?php endif; ?>
  74. </div>
  75. <div class="row">
  76. <hr style="margin-top:-5px;">
  77. <h2 class="centered" style="padding-top:65px;">Contact me</h2>
  78. <p class="centered" style="margin-bottom:80px;"><a href="/start-yout-project" class="btn btn-danger">Start your project</a></p>
  79. </div>
  80. </div>
  81.  
  82. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment