How to display two different custom taxonomy terms on a WooCommerce single product page

The WordPress documentation shows that an array is an acceptable argument for the taxonomy in get_the_terms (https://developer.wordpress.org/reference/functions/get_the_terms/). An array works if you are trying to get multiple taxonomies. It even works if you are trying to get just one taxonomy. But getting two single taxonomy arrays sequentially is what breaks this code. In the originally … Read more

Display all categories including sub categories under a list ul

Do you know how recursive functions are working? Here is an example: function get_categories_list( $parent ) { $args = array( ‘taxonomy’ => ‘product_cat’, ‘hide_empty’ => false, ‘parent’ => $parent ); $current_level_categories = get_terms( $args ); $result=””; if ( $current_level_categories ) { foreach ( $current_level_categories as $cat ) { if ( $cat->name == ‘Uncategorized’ ) continue; … Read more