kalponikoronno

loop one page theme lynda two

Feb 19th, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. <?php
  2. /**
  3. * The custom template for the one-page style front page. Kicks in automatically.
  4. */
  5.  
  6. get_header(); ?>
  7.  
  8. <div id="primary" class="content-area">
  9.     <div id="main" class="site-main">
  10.      ‍    <section class="call-to-action">
  11.             <div class="indent">
  12.                 <?php
  13.                 $query = new WP_query( 'pagename=book-an-appointment' );
  14.                 if($query->have_posts()) {
  15.                     while($query->have_posts()) {
  16.                         $query->the_post();
  17.                             echo '<div class="entry-content">';
  18.                                 the_content();
  19.                             echo '<div>';
  20.                     }
  21.                 }
  22.                 wp_reset_postdata();
  23.                 ?>
  24.             </div>
  25.         </section>
  26.      ‍    <section class="testimonial">
  27.             <div class="indent">
  28.                 <?php
  29.                 $args = array('posts_per_page' => 3, 'orderby' => 'rand', 'category_name' => 'testimonials');
  30.                 $query = new WP_query( $args );
  31.                     if($services_query->have_posts()) {
  32.                             echo '<ul class="services_list">';
  33.                                 while($services_query->have_posts()) {
  34.                                     $services_query->the_posts();
  35.                                     echo '<li class="clear">';
  36.                                     echo '<a href="'.get_permalink().'" title="Learn more about '.get_the_title().'">';
  37.                                     echo '<h3 class="service-title">'.get_the_title().' </h3>';
  38.                                     echo '</a>';
  39.                                     echo '<div class="services-lede">';
  40.                                     the_content();
  41.                                     echo '</div>';
  42.                                     echo '</li>';
  43.                                 }  
  44.                             echo '<ul>';
  45.                     }
  46.                 wp_reset_postdata();
  47.                 ?>
  48.             </div>
  49.         </section>     
  50.     </div>
  51. </div>
  52.  
  53. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment