我在主题选项中查询自定义分类法的输出时遇到一些问题。
我已经在下面列出了我认为必要的东西。
非常感谢您的帮助。
// Pull all the custom taxonomies into an array
$options_taxonomies = array();
$taxonomies_terms_obj = get_terms(\'portfolio_category\');
foreach ($taxonomies_terms_obj as $taxonomy) {
$options_taxonomies[$taxonomy->term_id] = $taxonomy->name;
}
// Select a Featured Homepage Category
$options[] = array(
\'name\' => __(\'Featured Homepage Category\', \'options_framework_theme\'),
\'desc\' => __(\'Choose a category to feature on your homepage.\', \'options_framework_theme\'),
\'id\' => \'homepage_feature\',
\'type\' => \'select\',
\'options\' => $options_taxonomies);
}
//The query
if ( function_exists( \'of_get_option\' ) ) :
query_posts( \'cat=\' . $homepage_feature = of_get_option( \'homepage_feature\' ) . \'&posts_per_page=3\' );