Widget dropdown always displays first option

I got an answer on WordPress Support forms, http://wordpress.org/support/topic/widget-dropdown-always-displays-first-option?replies=6 Replaced function form with, function form( $instance ) { // Check values $category = isset( $instance[‘category’] ) ? (int) $instance[‘category’] : ”; $terms = get_terms( ‘app_category’, ‘parent=0&hide_empty=0’ ); if ( !empty( $terms ) && !is_wp_error( $terms ) ) { ?> And changed, name=”<?php echo $this->get_field_name( ‘Category’ … Read more

List of users inside custom taxonomy

get_terms and get_posts return arrays not objects. Try this: <?php $disciplines = get_terms(‘disciplines’); foreach($disciplines as $discipline) { echo ‘<li><a href=”#”>’ . $discipline[‘name’] . ‘</a></li>’; $post_args = array( ‘post_type’ => ‘users’, ‘disciplines’ => $discipline[‘term_id’]); $posts = get_posts( $post_args ); foreach( $posts as $post ){ echo ‘post title: ‘ . $post[‘post_title’] . ‘<br />’; } } ?>

wp_query args adding muitiple tax_querys

You could use IF conditions to add the parameters, $args = array( ‘post_type’ => get_post_type(), ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘posts_per_page’ => -1, ‘no_found_rows’ => true, ‘tax_query’ => array(), ); if(condition){ $args[‘tax_query’] = array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘product_category’, ‘field’ => ‘slug’, ‘terms’ => array($category->slug), //Supply the current product_category terms ), array( … Read more