Didn't work
-
So here is my code I’m currently using for pulling category from custom custom taxonomy. Everything else seems to work but the featured image ??
<?php //get the current term from the header //then set the args for wp_list_categories $args = array( 'child_of' => $term->term_id, 'taxonomy' => $term->taxonomy, 'hide_empty' => 0, 'hierarchical' => true, 'depth' => 1, ); $categories = get_categories( $args ); foreach ( $categories as $category ) : ?> <div class="column half"> <article class="highlights <?php echo $category->term_id; ?>" itemscope="" itemtype="https://schema.org/Article"> <a href="<?php echo $category->slug; ?>" title="<?php echo $category->name; ?>" class="image-link"> <img width="343" height="127" src="<?php echo z_taxonomy_image_url($category->term_id, 'thumbnail'); ?>" class="image wp-post-image no-display" alt="<?php echo $category->name; ?>" title="<?php echo $category->name; ?>" itemprop="image"> </a> <div class="overlay"> <span class="meta"> <?php echo $category->description; ?> </span> <h2 itemprop="name"><a href="<?php echo $category->slug; ?>" title="<?php echo $category->name; ?>" itemprop="url"><?php echo $category->name; ?></a></h2> </div> </article> </div> <?php endforeach; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Didn't work’ is closed to new replies.