Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Resort Chains Custom Page
  4. */
  5.  
  6. // Custom Loop - Featured Properties
  7. add_action( 'genesis_loop', 'resort_chains_loop' );
  8.  
  9. function resort_chains_loop() {
  10. global $post;
  11.  
  12. /* Arguments */
  13. $args = array(
  14. 'post_type' => 'resort_chains',
  15. 'posts_per_page' => '48',
  16. 'orderby' => 'name',
  17. 'order' => 'ASC',
  18. );
  19.  
  20. $resort_chains_query = new WP_Query($args);
  21.  
  22. if ( $resort_chains_query -> have_posts() ) :
  23. while ( $resort_chains_query -> have_posts() ) : $resort_chains_query -> the_post();
  24. ?>
  25. <div class="resort_thumbnails_outer"> <?php /* outer div of thumbnails of resorts on resort chains page */?>
  26. <div class="resort_thumbnails_first" id="resort_chains"> <?php /* first inner div */?>
  27. <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a> <?php /* grab the featured thumbnail image and make it a link */ ?>
  28. <div class="resort_thumbnail_caption"> <?php /* caption box */?>
  29. <span><?php the_title(); ?></span> <?php /* title text in caption box */?>
  30. </div> <?php /* resort_thumbnail_caption */?>
  31. </div> <?php /* resort_thumbnails_first */?>
  32. <p class="resort_features">Ideal for: <?php the_field('ideal_for_adults'); ?><?php the_field('ideal_for_families'); ?></p>
  33. </div> <?php /* resort_thumbnails_outer */?>
  34. <?php
  35. endwhile;
  36. echo '</div>'; // home_slider
  37. do_action ( 'genesis_after_endwhile' );
  38. endif;
  39. wp_reset_postdata();
  40. }
  41.  
  42. add_action( 'genesis_loop', 'resort_chains_loop' );
  43. remove_action( 'genesis_loop', 'genesis_do_loop' );
  44.  
  45. genesis();
  46.  
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement