} } ?> </div> <?php } elseif ('Add Posts Manually' == get_sub_field('mtm_list_archive_select')) { // Post Type 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 } $grid_posts = _get_sub_field('mtm_list_archive_manual_posts'); if ($grid_posts) { global $post; $org_post = $post; // save this in case we are inside a nested query/post object foreach ($grid_posts as $post) { // variable must be called $post (IMPORTANT) setup_postdata($post); mtm_get_template_part('mtm-content', 'list-view'); } $post = $org_post; // reset to original query }
<div class="mtm-component--main"> <?php get_template_part('templates/page', 'header'); ?> <?php mtm_terms_from_taxonomy_links('type'); // output taxonomy ?> </div> <div class="mtm-component--content mtm-grid--wrapper"> <?php if (!have_posts()) { ?> <div class="alert alert-warning"> <?php _e('Sorry, no results were found.', 'spring'); ?> </div> <?php } ?> <?php while (have_posts()) { the_post(); ?> <?php get_template_part('mtm-templates/mtm-content', 'grid-view');
// Taxonomy Grid $grid_query = mtm_taxonomy_query('grid'); $taxonomy = mtm_acf_taxonomy_property('grid', 'taxonomy'); ?> <div <?php post_class('mtm-component--main'); ?> > <?php mtm_get_template_part('mtm-content', 'component-page'); ?> <?php if (_get_field('mtm_show_taxonomy_links')) { mtm_terms_from_taxonomy_links($taxonomy); // output taxonomy } ?> </div> <?php if ($grid_query->have_posts()) { ?> <div class="mtm-component--content mtm-grid--wrapper"> <div class="gallery-dynamic-row" > <?php while ($grid_query->have_posts()) { $grid_query->the_post();