wordpress get posts custom posts by meta key

Solutions on MaxInterview for wordpress get posts custom posts by meta key by the best coders in the world

showing results for - "wordpress get posts custom posts by meta key"
Gael
28 Sep 2019
1/* Query args. */
2$args = array(
3    'post_type' => 'reviews',
4    'posts_per_page' => -1,
5    'meta_key' => 'location', 
6    'meta_value' => 'berkshire'
7);
8
9/* Get Reviews */
10$reviews = get_posts( $args );
11