• Resolved kachan64

    (@kachan64)


    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="http://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; ?>

    https://wordpress.org/plugins/categories-images/

Viewing 1 replies (of 1 total)
  • Thread Starter kachan64

    (@kachan64)

    Derp! lol I found out the problem. I have:

    category 1
    – sub category item 1
    – sub category item 2

    category 2
    – sub category item 1
    – sub category item 2

    lol I was actually viewing category 2 when I uploaded the images for category 1

Viewing 1 replies (of 1 total)
  • The topic ‘Didn't work’ is closed to new replies.