Created
April 5, 2021 23:39
-
-
Save KeylorCR/e6060c86286b905d43cd95eb34240e97 to your computer and use it in GitHub Desktop.
Archive template for store CPT using the stores ordering configurations from WC Pickup Store settings page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
** The template for displaying archive store post type | |
** Current version: 1.5.13 | |
**/ | |
get_header(); ?> | |
<div id="primary" class="content-area"> | |
<header class="entry-header"> | |
<h1 class="wps-title page-title"><?= post_type_archive_title() ?></h1> | |
</header><!-- .page-header --> | |
<main id="main" class="site-main" role="main"> | |
<?php | |
$args = array( | |
'post_type' => 'store', | |
'post_status' => 'publish', | |
'posts_per_page' => -1, | |
'orderby' => WPS()->stores_order_by, | |
'order' => WPS()->stores_order | |
); | |
$query = new WP_Query($args); | |
if ( $query->have_posts() ) : | |
?> | |
<div class="archive-store-wrapper"> | |
<?php | |
while ( $query->have_posts() ) : $query->the_post(); | |
$city = wps_get_post_meta(get_the_ID(), 'city'); | |
$phone = wps_get_post_meta(get_the_ID(), 'phone'); | |
$description = wps_get_post_meta(get_the_ID(), 'description'); | |
?> | |
<div class="store-box-content"> | |
<?php do_action('wps_before_archive_store_content', get_the_ID()) ?> | |
<?php if(has_post_thumbnail()) : ?> | |
<div class="store-image"> | |
<?php the_post_thumbnail('thumbnail') ?> | |
</div> | |
<?php endif; ?> | |
<div class="store-content"> | |
<?php if(!empty($city)) : ?> | |
<h4><a href="<?php the_permalink() ?>"><?= sanitize_text_field($city) ?></a></h4> | |
<?php endif; ?> | |
<?php if(!empty($phone)) : ?> | |
<p><?= sanitize_text_field($phone) ?></p> | |
<?php endif; ?> | |
<?= apply_filters('the_content', $description) ?> | |
</div> | |
<?php do_action('wps_after_archive_store_content', get_the_ID()) ?> | |
</div> | |
<?php | |
endwhile; | |
wp_reset_postdata(); | |
?> | |
</div> | |
<?php else : ?> | |
<h3><?= __('No stores available', 'wp-pickup-store'); ?></h3> | |
<?php endif; ?> | |
</main><!-- .site-main --> | |
</div><!-- .content-area --> | |
<?php get_footer(); ?> |
the order mail is not reaching any of the configured stores
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I insert that code in which part?
Sorry I know very little!