コード例 #1
0
ファイル: functions.php プロジェクト: amperand/kidney
 function widget($args, $instance)
 {
     $widget_id = "widget_" . $args["widget_id"];
     $post_objects = get_field('show_featured_testimonial', $widget_id);
     $direction = get_field('display_orientation', $widget_id);
     if ($direction != "Vertical") {
         echo '<section class="flexslider testimonial-slider row interior widget horizontal"><div class="slides">';
     } else {
         echo '<section class="flexslider testimonial-slider row interior widget"><div class="slides">';
     }
     foreach ($post_objects as $post_object) {
         $donorDesc = get_field('donor_description', $post_object);
         $quote = get_field('quote', $post_object);
         $quote = kidney_string_limit_words($quote, 200);
         $ti = get_the_title($post_object);
         $perma = get_permalink($post_object);
         $imageSrc = get_field('featured_image', $post_object);
         $image = wp_get_attachment_image($imageSrc, 'thumbnail');
         if ($direction == "Vertical") {
             echo '<div class="columns medium-12 slide-item"><div class="columns medium-12 small-5"><a href="' . $perma . '">' . $image . '</a></div><div class="columns medium-12 small-7"><a href="' . $perma . '">' . $quote . '<h4>' . $ti . '</h4></a><p class="byline">' . $donorDesc . '</p></div></div>';
         } else {
             echo '<div class="columns medium-12 slide-item"><div class="columns large-7 medium-6 small-7">' . $quote . '<a href="' . $perma . '"><h4>' . $ti . '</h4></a><p class="byline">' . $donorDesc . '</p></div><div class="columns large-5 medium-6 small-5"><a href="' . $perma . '">' . $image . '</a></div></div>';
         }
     }
     echo '</div></section>';
 }
コード例 #2
0
ファイル: content-single.php プロジェクト: amperand/kidney
		<?php 
    }
    echo '</div>';
}
if (is_singular('post')) {
    $featuredImage = wp_get_attachment_image(get_field('featured_image'), 'featured');
    if ($featuredImage) {
        echo $featuredImage;
    }
} elseif (is_singular('testimonial')) {
    echo '<section class="flexslider testimonial-slider row small-collapse interior widget" id="interior-testimonial"><div class="slides">';
    $ti = get_the_title();
    $perma = get_the_permalink();
    $donorDesc = get_field('donor_description');
    $quote = get_field('quote');
    $quote = kidney_string_limit_words($quote, 200);
    $imageSrc = get_field('featured_image');
    $image = wp_get_attachment_image($imageSrc, 'thumbnail');
    echo '<div class="columns medium-12 slide-item "><div class="columns small-5"><a href="' . $perma . '">' . $image . '</a></div><div class="columns small-7"><br/><br/>' . $quote . '<h4>' . $ti . '</h4><p class="byline">' . $donorDesc . '</p></div></div>';
    echo '</div></section>';
} else {
    $featuredImage = wp_get_attachment_image(get_field('featured_image'), 'thumbnail');
    if ($featuredImage) {
        echo $featuredImage;
    }
}
$subtitle = get_field('sub_title');
if ($subtitle) {
    echo '<p class="subtitle">' . $subtitle . '</p>';
}
?>