first theme commit
This commit is contained in:
41
template-parts/partials/testimonials-loop.php
Normal file
41
template-parts/partials/testimonials-loop.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Testimonial Slider template.
|
||||
*
|
||||
* @package ThemeStarter
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<ul class="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8 py-8">
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'testimonials',
|
||||
'posts_per_page' => 4,
|
||||
'orderby' => 'rand',
|
||||
'order' => 'ASC',
|
||||
);
|
||||
$query = new WP_Query($args);
|
||||
if ($query->have_posts()) {
|
||||
while ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
?>
|
||||
<li class="list-none">
|
||||
<div class="flex flex-col items-center justify-center">
|
||||
<div class="inline-block relative">
|
||||
<img src="<?= get_field('testimonial_image') ?>" class="mb-4 mx-auto rounded-full w-44">
|
||||
</div>
|
||||
<p class="text-xl font-medium"><?php _e(the_title(), 'harplabs'); ?></p>
|
||||
<p class="text-lg"><?php _e(get_field('testimonial_position'), 'harplabs'); ?></p>
|
||||
<p class="text-lg text-stone-400"><?php _e(get_field('testimonial_company_name'), 'harplabs'); ?></p>
|
||||
<p class="mt-4 mx-auto text-center"><?php _e(get_field('testimonial_review'), 'harplabs'); ?></p>
|
||||
</div>
|
||||
</li>
|
||||
<?php }
|
||||
wp_reset_postdata();
|
||||
} else {
|
||||
// No posts found
|
||||
}
|
||||
?>
|
||||
</ul>
|
Reference in New Issue
Block a user