You should be able to do this with WP_Query
‘s meta_query
parameters:
$type="something";
$programme="another";
$args = array(
'meta_query' => array(
array(
'key' => 'type',
'value' => $type,
'compare' => '='
),
array(
'key' => 'programme',
'value' => $programme,
'compare' => 'LIKE'
)
)
);
$query = new WP_Query( $args );
Related Posts:
- How to rename a custom field?
- Custom Field Create Bulk via SQL Query
- searching by keywords in post’s metas or pagination links problem
- SQL Query to copy value of a meta_key into another meta_key
- How to correctly call custom field dates into a posts_where filter using SQL statements
- Add custom fields to search
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- How can I make wp-pagenavi work on a custom query built upon a form submission? [closed]
- Meta Query with AND & OR?
- Bulk move (or copy) from a custom field to the post content?
- Up/Down voting system for WordPress
- Custom Fields Bulk Edit
- Plugin similar to Taxonomy Drill-Down for custom fields?
- How do I query for a post by custom field?
- Count how many posts have a custom field set
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- sort search results by custom fields using dropdown
- Get all posts that do not have a specific custom field without using a subquery
- How can I sort homepage by a meta value?
- Loop to display random posts only if a custom field matches category
- Conditional custom field query
- Order query by meta_value with multiple custom fields
- Display only past events on that page using Visual Composer Grid Bulider
- Create Pop-Up Box with Custom Field Content Inside the Loop
- query usermeta from custom field
- Is there any way to get all meta and standard columns for any WordPress object after searching based on meta key and value
- Order RSS content by an advanced custom field value
- UPDATE on SELECT results. A SQL query to swap Author with Meta Box value
- Alter main archive, to show posts with meta as last
- Meta Query And/Or
- Trying to reorder posts by custom field
- Limits, not all post are showen when querying for posts by view count
- Why orderbyb meta_value_num won’t affect the generated SQL Query order?
- Get post ids sorted by meta_key
- querying a custom field
- pre_get_posts : only get posts by wp_usermeta value
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- How to query an out put value?
- List custom queried terms in the edit-tags.php?taxonomy page
- Modify date query by URL parameter using pre_get_posts and $_GET
- Get emails from users by custom field SQL
- Loop through incrementing custom fields
- Custom search SQL Query to add custom field in result
- The best way to collision check in WP
- SQL: Select wordpress posts with given text string and add a custom field to them?
- How to exclude custom fields from search queries?
- WP_Query () using taxonomy, custom post types
- Show array of meta_value in Edit Post Coloum
- How to query for posts with either one or another custom field
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- Custom Query: query by post custom meta data
- Get array of posts based on custom field values
- Searching with Multiple (Parallel) Criteria on Custom Fields?
- How to query posts by month based on date custom field?
- Custom Field Date Problem
- Compare ACF date field (if exists) and post date and order DESC
- Change word in woocommerce product category custom field
- Problem with revisions only returning four results
- Search & column order by meta value in admin
- Dynamically populate query source in Elementor post widget
- SQL query to change the value of a Custom Field
- select user with all meta field and field value. I am use Below Query for this ,So any of know another way to fast query instead of below query?
- Create custom query for search?
- Convert all dates in field to Unix time, except those already in Unix time
- Meta_query not filtering posts
- Get multiple posts with some custom fields efficient
- How to add a prefix to existing custom fields over MYSQL query?
- Complex WP_Query Using Post Date And Post Meta
- Alter SQL query to return posts with unique custom field value, no duplicate values
- How to check if custom field exists in this widget query
- Only show content slideshow if “slideshow” custom field exists
- Update field name without losing the value
- How to display search query as formatted text?
- How to add a custom field in the advanced menu properties?
- Sortable Custom Columns in User Panel (users.php)?
- Add meta data to the menu
- Copy SEO Meta Desc “Custom Field” to Excerpt field?
- Order Custom post type loop by custom field (datepicker)
- How to edit multiple post with Custom fields
- How can I show custom fields in the loop only to specific user roles?
- How to add new field to the account address?
- Split the_title
- Display Multiple Values of Same Key
- How to Wrote Simple Calculations by Using Custom Fields in Loop?
- The conditional logic only works to show or hide?
- Odd functions.php issue in WordPress
- Filter or order based on custom field
- How to improve my non-unique metadata MySQL entries?
- Delete oldest wordpress post (SQL query)
- Custom Fields Not Showing (ACF not installed)
- Query multiple meta values at the same time :
- How to Find List of Available Custom Fields for Theme?
- get wordpress post loop by meta box date
- Sort posts by custom fields with empty values
- Sub Field of File Field
- ACF plugin and field update
- My meta boxes update wp_postmeta of posts but not of pages. What is wrong with the code?
- Media Custom Fields – get a value with PHP
- jaredatch metaboxes on video post formats
- How to add an ACF only for parent term?