Exemplo n.º 1
0
 /**
  * Displays the slider for the homepage
  */
 public function render_homepage_slider()
 {
     $slider = new BlizzardWatchSlider();
     if (have_rows('slides', 'option')) {
         while (have_rows('slides', 'option')) {
             the_row();
             $post = get_sub_field('post');
             $text = get_sub_field('text_override');
             $image = get_sub_field('image_override');
             $link = get_permalink($post->ID);
             if (!$text) {
                 $text = $post->post_title;
             }
             if (!$image) {
                 $image = get_the_post_thumbnail_url($post->ID);
             }
             $slider->add_slide($image, $text, $link);
         }
     }
     $slider->render_slider();
 }