Last active
October 9, 2019 12:32
-
-
Save UraraReika/2ac0f0c74059aebe71b4ccce2b3652aa to your computer and use it in GitHub Desktop.
Get custom taxonomy image and display it, as tile background of Jet Woo Taxonomy Tiles Widget
This file contains 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 | |
add_filter( 'jet-woo-builder/jet-woo-taxonomy-tiles/tax_thumbnail', '__your_prefix_display_taxonomy_thumbnail', 10, 2 ); | |
function __your_prefix_display_taxonomy_thumbnail( $image_key, $tax ) { | |
if ( $tax->taxonomy === 'category' ) { | |
$image_key = 'category_featured_image'; | |
} elseif ( $tax->taxonomy === 'post-custom-tax' ) { | |
$image_key = 'custom_taxonomy_featured_image'; | |
} | |
return $image_key; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment