function wpsight_listing_archive_query($query) { if (is_post_type_archive(array(wpsight_listing_post_type())) && $query->is_main_query() && !is_admin()) { // Get listing search query $args = wpsight_listing_archive_query_args(); foreach ($args as $k => $v) { $query->set($k, $v); } } return $query; }
<h1> <?php // Display post type post_type_archive_title(); ?> </h1> <?php // Action hook to add content to title do_action('wpsight_loop_title_actions'); ?> </div><!-- .title --><?php // Action hook to add content after archive title do_action('wpsight_listing_archive_title_after', wpsight_listing_archive_query_args(), $content_class); ?> <?php if (have_posts()) { ?> <div class="row"> <?php // Create loop counter $counter = 0; while (have_posts()) { // Increase loop counter $counter++; the_post();