function mtm_taxonomy_query_sub($archivetype, $display = 3, $order = 'DESC', $orderby = 'date') { $taxonomy = mtm_acf_taxonomy_sub_property($archivetype, 'taxonomy'); $terms = mtm_acf_taxonomy_sub_property($archivetype, 'name'); if (get_sub_field('mtm_' . $archivetype . '_archive_taxonomy_number')) { $display = get_sub_field('mtm_' . $archivetype . '_archive_taxonomy_number'); } return mtm_page_component_taxonomy_query($taxonomy, $terms, $display, $orderby, $order); }
<?php $taxurl = mtm_acf_taxonomy_sub_property('home_topic', 'taxonomy'); $termurl = mtm_acf_taxonomy_sub_property('home_topic', 'slug'); $pathurl = $taxurl . '/' . $termurl; ?> <h3 class="mtm-home-topic--label <?php echo esc_html($termurl); ?> "><a href="<?php echo esc_url(home_url($pathurl)); ?> "><?php echo esc_html(mtm_acf_taxonomy_sub_property('home_topic', 'name')); ?> </a></h3> <?php the_mtm_post_thumbnail('medium_large', 'mtm-home-topic--image'); ?> <h4 class="mtm-home-topic--primary"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4>
<?php } if ('Pick From Taxonomy' == get_sub_field('mtm_list_archive_select')) { // Taxonomy Source ?> <div class="mtm-module--list"> <?php if (_get_sub_field('mtm_show_taxonomy_links')) { mtm_terms_from_taxonomy_links(get_sub_field('mtm_list_archive_taxonomy_links')); // output taxonomy } $list_query = mtm_taxonomy_query_sub('list'); $taxonomy = mtm_acf_taxonomy_sub_property('list', 'taxonomy'); $terms = mtm_acf_taxonomy_sub_property('list', 'slug'); if ($list_query->have_posts()) { global $post; $org_post = $post; // save this in case we are inside a nested query/post object while ($list_query->have_posts()) { $list_query->the_post(); mtm_get_template_part('mtm-content', 'list-view'); } $post = $org_post; // reset to original query } if (_get_sub_field('mtm_show_view_all_link')) { ?> <a class="mtm-view-all-link" href="<?php