$this->description = $description; $this->link = $link; $this->thumbnail = $thumbnail; } } $plugs = []; if (have_rows('section_plugs', 'option')) { while (have_rows('section_plugs', 'option')) { the_row(); $type = get_sub_field('type'); if ($type == 'category') { $term = get_sub_field('term_object'); $name = $term->name; $description = $term->description; $url = get_term_link($term->term_id); $thumbnail = cfi_featured_image_url(array('size' => 'full', 'cat_id' => $term->term_id)); array_push($plugs, new Plug($name, $description, $url, $thumbnail)); } elseif ($type == 'page') { $post = get_sub_field('post_object'); $title = $post->post_title; $description = get_sub_field('post_description'); $url = get_post_permalink($post->ID); $thumbnail = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); array_push($plugs, new Plug($title, $description, $url, $thumbnail)); } } } foreach ($plugs as &$plug) { ?> <div class="section-plug"> <div class="image" style="background-image: url(<?php
<div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php if (have_posts()) { ?> <div class="posts-header archive-header"> <?php the_archive_title('<h2 class="page-title">', '</h2>'); the_archive_description('<div class="taxonomy-description">', '</div>'); $cat_id = get_query_var('cat'); ?> <div class="image" style="background-image: url(<?php echo cfi_featured_image_url(array('size' => 'full', 'cat_id' => $cat_id)); ?> )"></div> </div><!-- .posts-header --> <div class="container"> <div class="posts-list"> <?php /* Start the Loop */ while (have_posts()) { the_post(); /* * 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());