| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
$the_query = isset( $args['template_args']['the_query'] ) ? $args['template_args']['the_query'] : ''; |
| 8 |
$title = isset( $args['template_args']['title'] ) ? $args['template_args']['title'] : ''; |
| 9 |
|
| 10 |
if(isset($the_query->found_posts) && $the_query->found_posts == 0){ |
| 11 |
return; |
| 12 |
} |
| 13 |
?> |
| 14 |
|
| 15 |
<div class="container mb-1"> |
| 16 |
<div class="row"> |
| 17 |
<div class="col-sm p-0"> |
| 18 |
<h3><?php echo esc_html( $title ); ?></h3> |
| 19 |
</div> |
| 20 |
<div class="col p-0 d-none d-sm-block"> |
| 21 |
<div class="btn-toolbar justify-content-end" role="toolbar" aria-label="Toolbar with button groups"> |
| 22 |
<div class="btn-group btn-group-sm uwp-list-view-select" role="group" aria-label="First group"> |
| 23 |
<button type="button" class="btn btn-outline-primary active uwp-list-view-select-list" onclick="uwp_list_view_select(0);"><i class="fas fa-th-list"></i></button> |
| 24 |
<button type="button" class="btn btn-outline-primary uwp-list-view-select-grid" onclick="uwp_list_view_select(3);"><i class="fas fa-th"></i></button> |
| 25 |
</div> |
| 26 |
</div> |
| 27 |
</div> |
| 28 |
</div> |
| 29 |
</div> |
| 30 |
<div class="uwp-profile-cpt-loop"> |
| 31 |
<?php |
| 32 |
|
| 33 |
// The Loop |
| 34 |
if ( $the_query && $the_query->have_posts() ) { |
| 35 |
|
| 36 |
echo '<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3">'; |
| 37 |
while ( $the_query->have_posts() ) { |
| 38 |
$the_query->the_post(); |
| 39 |
|
| 40 |
uwp_get_template( 'bootstrap/posts-post.php', $args ); |
| 41 |
|
| 42 |
} |
| 43 |
echo '</div>'; |
| 44 |
|
| 45 |
/* Restore original Post Data */ |
| 46 |
wp_reset_postdata(); |
| 47 |
} |
| 48 |
|
| 49 |
do_action( 'uwp_profile_pagination', $the_query->max_num_pages ); |
| 50 |
?> |
| 51 |
</div> |