Created
July 2, 2015 10:20
-
-
Save vajrasar/20eb59b71880589f47c6 to your computer and use it in GitHub Desktop.
Using ACF for taxonomy images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $prod_cats = get_terms( 'product_cat', 'hide_empty=0' ); | |
| ?> | |
| <ul class="gk-special-menu"> | |
| <?php | |
| foreach( $prod_cats as $cat ){ | |
| $name = $cat->name; | |
| $prod_term_link = get_term_link( $cat ); | |
| $img_obj = get_field( 'product_cat_img', 'product_cat_'.$cat->term_id ); | |
| ?> | |
| <li data-scroll-reveal="enter bottom over .25s after .5s"> | |
| <h4><?php echo $name; ?></h4> | |
| <a href="<?php echo $prod_term_link; ?>"> | |
| <img class="alignnone size-full wp-image-974" src="<?php echo $img_obj['url']; ?>" width="185" height="256" /> | |
| </a> | |
| </li> | |
| <?php | |
| } | |
| ?> | |
| </ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment