<div class="row">
<div class="small-12 columns">
- <?php if (is_page('recipes')) { ?>
- <?php
- //list terms in a given taxonomy using wp_list_categories (also useful as a widget)
- $orderby = 'name';
- $show_count = 0; // 1 for yes, 0 for no
- $pad_counts = 0; // 1 for yes, 0 for no
- $hierarchical = 1; // 1 for yes, 0 for no
- $taxonomy = 'recipe';
- $title = '';
+ <?php if (is_page('recipes')) {
+ $customPostTaxonomies = get_object_taxonomies('recipe');
- $args = array(
- 'orderby' => $orderby,
- 'show_count' => $show_count,
- 'pad_counts' => $pad_counts,
- 'hierarchical' => $hierarchical,
- 'taxonomy' => $taxonomy,
- 'title_li' => $title
- );
- ?>
- <ul>
- <?php
- wp_list_categories($args);
- ?>
- </ul>
- <?php } else { ?>
+ if(count($customPostTaxonomies) > 0)
+ {
+ foreach($customPostTaxonomies as $tax)
+ {
+ $args = array(
+ 'orderby' => 'name',
+ 'show_count' => 0,
+ 'pad_counts' => 0,
+ 'hierarchical' => 1,
+ 'taxonomy' => $tax,
+ 'title_li' => ''
+ );
+
+ wp_list_categories( $args );
+ }
+ }
+ } else { ?>
<?php if(have_posts()) : while(have_posts()): the_post();?>
<?php the_content();?>
<?php endwhile; else:?>