You can use a meta_query in your WP_Query
$args = array(
'post_type' => 'company',
'meta_query' => array(
array(
'key' => 'service_XXXX_price',
'value' => '0',
'compare' => '!=',
),
),
);
$company_query = new WP_Query( $args );
You can find more infos about the meta querys in the codex: https://codex.wordpress.org/Class_Reference/WP_Query
Related Posts:
- How to get all term meta for a taxonomy – getting term_meta for taxonomy
- Job of meta_key meta_value fields in database tables
- order by multiple meta_keys?
- How to get the total number of meta_values based on a custom post type?
- WP_POSTMETA – What do these values mean inside the data structure?
- How can I convert postmeta from unserialized to serialized?
- Sort custom posts in archive by multiple values: date AND meta key
- why after saving meta value it’s saving all the values the one that i clicked?
- Is it safe to add a new field to meta_value field?
- How can I use ‘orderby’ => ‘meta_value_num’ to order by the numerical value even if the value starts with a word?
- Display current ranking of post as a number in post title
- I can not display meta value in extras.php and template-tags.php
- Count Post and Page Views based on meta_value Using Shortcode in Dashboard Widget
- Negative meta_query if storing multiple post_meta values with shared meta_key
- if get_post_meta function returns empty – Do Not Display HTML
- How to get the total of two meta values from different meta keys?
- How to save a meta_value as a numeric value after I retrieve it via update_post_meta?
- How to update/add child posts meta whenever the parent post meta is updated?
- Multiple meta key and value search in the query
- Posts with no meta field do not appear when sorting by meta field
- Sorting meta box values by start- and enddate and all dates in between
- How to only display posts whose meta_value field is not empty?
- Check if Post Title exists, Insert post if doesn’t, Add Incremental # to Meta if does
- Orderby meta_value only returns posts that have existing meta_key
- Meta compare with date (stored as string) not working
- How to update/insert custom field(post meta) data with wordpress REST API?
- Front-end update_post_meta snippet displays white screen?
- How to get meta value in wp_attachment_metadata
- Clean up output added via wp_head()
- WordPress Admin Panel search posts with custom post meta values along with title
- get_post_custom()
- Get post from meta_key and meta_value
- get_post_meta returns bool(false)
- How to get custom post type to display post meta on archive pages?
- WP_POSTMETA changes site crash
- meta_post_meta return value 1
- How to use post_id with a Class?
- Set default Custom Post Meta Value
- INSERT ON DUPLICATE KEY UPDATE failes in postmeta table
- Set Checkbox as checked by default
- replacing the_autor or make callback
- Some post meta fields stop saving after a few successful saves
- Save an array of values in the post meta box
- Sort alphabetically by custom field
- get_post_meta() empty in preview WHEN custom post is published [closed]
- Add Embed.ly API objects to post_meta on update
- Editing does not change post_name
- Compare string with post id in wpdb and do stuff when match is found
- $wpdb class updating meta_value using Ajax [closed]
- How to selected which tags to print, instead of printing the whole tag list?
- How to avoid duplicating same meta_value?
- query posts and split meta information into separate div’s
- add unique string as custom-field to every post
- How do I insert a new meta key / value pair, but only if another meta key is present?
- “Cannot use import statement outside a module” JS error while adding a custom meta block?
- Gutenberg featured image checkbox – checkbox not correctly set on editing page reload
- How to properly use oneOf and anyOf in Rest Schema?
- Get the author meta adds now
- wordpress is_front_page() issue
- show ad after # paragraphs
- If ACF meta_key has meta_value
- Sort column on meta key and meta value
- How we can get “get_post_meta” of specific user who added it
- Repeated nav bar queries failing to be cached
- Randomizing Post Links Outside of Loop – No Author or Date
- help to decipher wp metadata
- Sort taxonomy page alphabetically by meta rather than default post date
- Insert Custom Field Value
- delete duplicates wp_postmeta
- SQL query – get a featured image’s alt / alternative text
- update_post_meta() updating nested array in Multidimensional array with empty sub-array
- How do I list taxonomies that have upcoming events in WP? Is there a way to do this without having to query posts first?
- Order (by ASC) posts with meta_key so posts without values are last
- Sorting my posts on homepage my specific value in post_meta table
- Strict comparisons problem when using boolean post meta
- Why is the actual number of thumbnail images not matching what is store in an attachments metadata?
- How to use multiple Meta Field from CPT as Post permalink
- Set class if a meta value is set within post archive
- Check if any meta on the post has value then display content
- Combine meta query and give a specific meta query a higher priority
- Get table parameter and save in meta value
- How can i show post views using specified post ID?
- How to add/update post meta to use in query?
- gettext localization is not working
- Move Entry Meta Above Title in Archives (Genesis + Brunch Pro)
- Exclude category from DB query
- Why are my custom metaboxes not updating the post meta?
- Problem serializing single quote and double quote into post meta
- Storing post_meta fields in array
- Performace on 1 million plus meta fields vs 1 field with 1 million multi array
- Fetching array of postmeta with $wpdb and in_array conditional
- Piklist File Upload
- how to echo/display the custom field value in specific custom field name?
- update_post_meta() not working in bulk option
- How to update the ‘modified_time’ of a post ONLY when content is changed?
- Custom Field: Display only if a specific key is selected outside the loop
- Multiple If else statements on Search Result Page
- get_children filter with postmeta
- Custom taxonomy with custom meta value is not sorting correctly (query returns the same value for orderby regardless of sort column click)
- Post meta box data not saving