<div class="container"> <?php /* * Order Posts based on Date Picker value * this example expects the value to be saved in the format: yymmdd (JS) = Ymd (PHP) */ $posts = get_posts(array('post_type' => 'project', 'meta_key' => 'end_date', 'orderby' => 'meta_value_num', 'posts_per_page' => -1, 'order' => 'DESC')); if ($posts) { echo '<ul class="list-ui">'; foreach ($posts as $post) { echo '<li>'; setup_postdata($post); $client_logo = get_field('client_logo'); $client_logo_url = $client_logo['url']; $client_logo_alt = $client_logo['alt']; eduardodomingos_get_template_part('template-parts/content', get_post_format(), array('post_id' => $post->ID, 'template_type' => 'media', 'thumb_url' => $client_logo_url, 'thumb_alt' => $client_logo_alt, 'show_excerpt' => true)); echo '</li>'; } wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly echo '</ul>'; } ?> </div><!-- .container --> </div><!-- .band --> <?php if (comments_open() || get_comments_number()) { ?> <?php // If comments are open or we have at least one comment, load up the comment template.
if (have_posts()) { ?> <div class="band band--shaded"> <div class="container"> <ul class="list-block"> <?php while (have_posts()) { the_post(); ?> <?php $featured_image_4x1 = get_field('featured_image_4x1'); $featured_image_4x1_url = $featured_image_4x1['url']; $featured_image_4x1_alt = $featured_image_4x1['alt']; echo '<li>'; eduardodomingos_get_template_part('template-parts/content', get_post_format(), array('post_id' => $post->ID, 'template_type' => 'block', 'featured_image_4x1_url' => $featured_image_4x1_url, 'featured_image_4x1_alt' => $featured_image_4x1_alt)); echo '</li>'; ?> <?php } // End of the loop. ?> <?php wp_reset_postdata(); ?> </ul> </div><!-- .container --> </div><!-- .band --> <?php }
/* Start the Loop */ ?> <?php while (have_posts()) { the_post(); ?> <li> <?php $featured_image_16x9 = get_field('featured_image_16x9'); $featured_image_16x9_url = $featured_image_16x9['url']; if (eduardodomingos_photon_enabled()) { // Photon enabled, so we go responsive. $featured_image_16x9_url = apply_filters('jetpack_photon_url', $featured_image_16x9_url); } $featured_image_16x9_alt = $featured_image_16x9['alt']; eduardodomingos_get_template_part('template-parts/content', get_post_format(), array('post_id' => $post->ID, 'template_type' => 'media', 'thumb_url' => $featured_image_16x9_url, 'thumb_alt' => $featured_image_16x9_alt, 'show_excerpt' => false)); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ //get_template_part( 'template-parts/content', get_post_format() ); ?> </li> <?php } ?> </ul> </div> </div>