Target a page with query

I have checked at the source code and found $_GET as a solution to target them. $type = isset($_GET[“type”]) ? $_GET[“type”] : ‘story’; if( is_page(‘post-create-page’) && $type==’story’ ) { ….} elseif ( is_page(‘post-create-page’) && $type==’openlist’ ) {…..}

get products by custom date variable

Try use meta_value instead of meta_value_num. $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 20, ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘pa_review_date’, );

Exclude in get_pages() based on meta field

You can using get_posts(). $pages_args = array( ‘orderby’ => ‘menu_order’, ‘parent’ => 0, ‘post_type’ => ‘guideline’, ‘post_status’ => ‘publish’, ‘meta_key’ => ‘no-visit’, ‘meta_value’ => ‘true’ ); $pages = get_posts($pages_args); $pages_args = array( ‘orderby’ => ‘menu_order’, ‘parent’ => 0, ‘post_type’ => ‘guideline’, ‘post_status’ => ‘publish’, ‘meta_query’ => array( array( ‘key’ => ‘no-visit’, ‘value’ => ‘true’, ‘compare’ … Read more

Problem on displaying the results on my query

You need to use WordPress meta query: Display posts where the custom field key is ‘extra1’ and the custom field value is ‘test’: $query = new WP_Query( array( ‘meta_key’ => ‘extra1’, ‘meta_value’ => ‘test’ ) ); For more info take a look at WP Query Custom_Field_Parameters.