'atleta', 'posts_per_page' => 15, 'paged' => $paged, 'orderby' => 'rand', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'perfil_visivel', 'value' => 1, 'compare' => '=' ), array( 'key' => 'confirmacao', 'value' => "confirmado", 'compare' => '=' ), ) ); if($nome){ $args["s"] = $nome; } if($sexo || $tempo || $nivel || $canais){ $args["tax_query"] = array('relation' => 'AND'); } if($sexo){ $args["tax_query"][1] = array( 'taxonomy' => 'sexo', 'field' => 'slug', 'terms' => $sexo, ); } if($tempo){ $args["tax_query"][2] = array( 'taxonomy' => 'tempo', 'field' => 'slug', 'terms' => $tempo, ); } if($nivel){ $args["tax_query"][3] = array( 'taxonomy' => 'nivel', 'field' => 'slug', 'terms' => $nivel, ); } if($canais){ $args["tax_query"][4] = array( 'taxonomy' => 'canais', 'field' => 'slug', 'terms' => $canais, ); } add_filter('posts_orderby', 'edit_posts_orderby'); $wp_query = new WP_Query($args); remove_filter('posts_orderby', 'edit_posts_orderby'); ?>