Created
July 5, 2011 21:03
-
-
Save mattboon/1065927 to your computer and use it in GitHub Desktop.
Output Taxonomy Custom Fields I
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 $faq_categories = get_categories(array( 'taxonomy' => 'question-category' )); ?> | |
<?php foreach($faq_categories as $category):?> | |
<?php | |
$category_custom_fields = get_option( "taxonomy_term_$category->term_id" ); | |
$category_order = $category_custom_fields[question_category_order]; | |
$category_column = $category_custom_fields[question_category_column]; | |
?> | |
<?php query_posts(array( 'post_type' => 'question', 'showposts' => -1, 'question-category' => $category->slug, 'order' => 'ASC' ));?> | |
<?php if (have_posts()) : ?> | |
<section> | |
<h2> | |
<?= $category->name; ?> | |
</h2> | |
<ul> | |
<?php while (have_posts()) : the_post(); ?> | |
<li> | |
<a href="<?php the_permalink(); ?>"> | |
<?php the_title(); ?> | |
</a> | |
</li> | |
<?php endwhile; ?> | |
</ul> | |
</section> | |
<?php endif; ?> | |
<?php wp_reset_query(); ?> | |
<?php endforeach; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment