-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaxonomy-waymark_collection.php
52 lines (43 loc) · 1.72 KB
/
taxonomy-waymark_collection.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Collection Archive Template
*
* Waymark uses the custom taxonomy 'waymark_collection' to group maps together.
*
* By default, viewing the Collection page will list maps in that Collection the
* same as any other archive page. This template allows you to customize that
* how the maps are displayed. Here we are using the Shortcode to display the
* entire collection in a single Map. Below that we are using the Shortcode to
* display each Map in the Collection as a small Map.
*
* Learn More
*
* http://codex.wordpress.org/Template_Hierarchy
* https://www.waymark.dev/docs/shortcodes/
*
**/
get_header();?>
<article id="collection-<?php the_ID();?>" <?php post_class();?>>
<!-- Shortcode with all Maps in Collection -->
<?php echo do_shortcode('[Waymark collection_id="' . get_queried_object()->term_id . '" show_gallery="0" shortcode_header="0"]'); ?>
<!-- Collection Description -->
<?php if (term_description()): ?>
<div class="px-3">
<p class="lead text-center mb-5"><?php echo term_description() ?></p>
</div>
<?php endif;?>
</article>
<?php map_first_archive_pagination();?>
<!-- Mini Maps -->
<div class="row mb-4">
<!-- This is the WordPress Loop (See https://developer.wordpress.org/themes/basics/the-loop/) -->
<?php if (have_posts()): while (have_posts()): the_post();?>
<!-- Bootstrap utility classes for layout -->
<article <?php post_class('col-sm-6 col-md-4 py-4');?>>
<!-- Tweak the Shortcode to display a smaller Map with some custom options -->
<?php echo do_shortcode('[Waymark map_id="' . $post->ID . '" map_height="300" shortcode_header="1" show_gallery="0"]'); ?>
</article>
<?php endwhile;endif;?>
</div>
<?php map_first_archive_pagination();?>
<?php get_footer();?>