wordpress查询自定义字段为特定值的文章

'post', 'meta\_key'=>'identityNo', 'post\_status'=> 'publish', 'posts\_per\_page' => -1, 'meta\_query' => array( array( 'key' => 'identityNo', 'value' => $\_POST\['identityNo'\], ), ) ); $nQuery = new WP\_Query( $args ); if ( $nQuery -> have\_posts() ) { while ( $nQuery ->have\_posts() ) : $nQuery ->the\_post(); //loop endwhile; } ?>

参考资料: http://jokerliang.com/wordpress-custom-fields-to-support-between-queries.html https://codex.wordpress.org/Class\_Reference/WP\_Query