wordpress Meta_query between numbers range (not working)

you can use meta query operators like below query. See docs for meta_query parameters here $range = $_GET[‘range’]; // assuming you get the range from query string parameter which 11-19 $range_array = explode(‘-‘,$range); $args = array( ‘post_type’ => ‘YOUR-POST-TYPE’, ‘meta_query’ => array( array( ‘key’ => ‘sizes_avaliable’, ‘value’ => $range_array, ‘compare’ => ‘BETWEEN’ ), ) ); … Read more

Is it possible to query a custom field where the value is between two fields?

I think it is pretty simple. I got the reference from here: https://www.advancedcustomfields.com/resources/query-posts-custom-fields/ $findNumber = 150; $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘photos-videos’, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘max_number’, ‘value’ => $findNumber, ‘type’ => ‘NUMERIC’, ‘compare’ => ‘>=’ ), array( ‘key’ => ‘min_number’, ‘value’ => $findNumber, ‘type’ => ‘NUMERIC’, … Read more

Custom loop not working

Try this: $args = array( ‘post_type’=> ‘televisie’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 5, ‘meta_key’ => ‘layout_meta_box’, ‘meta_value’ => ‘synopsis’, ); A helpful article too: https://css-tricks.com/snippets/wordpress/custom-loop-based-on-custom-fields/

Omit custom post type from wp-sitemap.xml based on meta key using wp_sitemaps_posts_query_args

The error happens because the filter callback (shapeSpace_disable_sitemap_post_meta()) expects to receive two parameters ($args and $post_type) and yet you call add_filter() without setting the fourth parameter to 2. So to solve the problem: // Replace this: add_filter(‘wp_sitemaps_posts_query_args’, ‘shapeSpace_disable_sitemap_post_meta’); // with this one: add_filter(‘wp_sitemaps_posts_query_args’, ‘shapeSpace_disable_sitemap_post_meta’, 10, 2);

Filter Loop by Custom Field Value

How about this: $my_query = new WP_Query(array( ‘post_type’=> ‘custom_type’, ‘post_status’ => ‘publish’, ‘meta_key’ => ‘my_custom_field’, ‘meta_value’ => ‘custom field value’ )); if($my_query->have_posts()): while($my_query->have_posts()):$my_query->the_post(); //All the post stuff here. endwhile; endif; wp_reset_postdata(); Check this out.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)