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
//To display an image using ACF, one would set the image custom field to image url and call the img as follows: | |
<?php if( get_field( 'field_name' ) ): ?> | |
<?php while( has_sub_field( 'field_name' ) ): ?> | |
<img src="<?php the_sub_field( 'image' ); ?>" alt=""> | |
<?php endwhile; ?> |
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
/*ACF taxonomy parent*/ | |
// category ancestor location rule | |
add_filter('acf/location/rule_types', 'acf_location_types_category_ancestor'); | |
function acf_location_types_category_ancestor($choices) | |
{ | |
if (!isset($choices['Post']['post_category_ancestor'])) { | |
$choices['Post']['post_category_ancestor'] = 'Post Category Ancestor'; | |
} | |
return $choices; | |
} |