first theme commit
This commit is contained in:
33
template-parts/partials/client-grid.php
Normal file
33
template-parts/partials/client-grid.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Client grid template.
|
||||
*
|
||||
* @package ThemeStarter
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<ul class="grid grid-cols-3 md:grid-cols-6 2xl:grid-cols-12 gap-4 items-center justify-items-center filter grayscale">
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'clients',
|
||||
'posts_per_page' => 12,
|
||||
'orderby' => 'date',
|
||||
'order' => 'ASC',
|
||||
);
|
||||
$query = new WP_Query($args);
|
||||
if ($query->have_posts()) {
|
||||
while ($query->have_posts()) {
|
||||
$query->the_post(); ?>
|
||||
<li>
|
||||
<a target="_blank" href="<?= get_field('client_website') ?>"><img src="<?= get_field("client_logo"); ?>" alt="<?= the_title() ?> logo"></a>
|
||||
</li>
|
||||
<?php }
|
||||
wp_reset_postdata();
|
||||
} else {
|
||||
// No posts found
|
||||
}
|
||||
?>
|
||||
</ul>
|
Reference in New Issue
Block a user