| 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 |
<h3><?php echo esc_html( $title ); ?></h3> |
| 11 |
<div class="uwp-profile-item-block"> |
| 12 |
<?php |
| 13 |
// The Loop |
| 14 |
if ($the_query && $the_query->have_posts()) { |
| 15 |
|
| 16 |
echo '<ul class="uwp-profile-item-ul">'; |
| 17 |
while ($the_query->have_posts()) { |
| 18 |
$the_query->the_post(); |
| 19 |
uwp_get_template('posts-post.php', $args); |
| 20 |
} |
| 21 |
echo '</ul>'; |
| 22 |
|
| 23 |
/* Restore original Post Data */ |
| 24 |
wp_reset_postdata(); |
| 25 |
} else { |
| 26 |
// no posts found |
| 27 |
echo "<p>" . esc_html( sprintf( __( "No %s found.", 'userswp' ), $title ) )."</p>"; |
| 28 |
} |
| 29 |
do_action('uwp_profile_pagination', $the_query->max_num_pages); |
| 30 |
?> |
| 31 |
</div> |