You can’t, at least not efficiently. You best bet is to use the LIKE
statement, but it would fail for searches like “title”, “link”, “mp3” 🙂
I suggest you build your own serialization method. For example, store the tracklist as a string like this:
Track1 title
Track2 title
Notice the new line character (\n
). Use it to split the string into an array when you need to use the meta value.
Then you can have something like:
..
'meta_query' => array(
array(
'key' => 'tracklist',
'value' => 'Starway to Heaven',
'compare' => 'LIKE',
)
)
...
The download links can go into a separate meta record.
Related Posts:
- How do you get posts by meta_query using the JSON API plugin?
- meta_query date and time comparisons
- Serialized array, grab specific posts with meta_key/meta_value[0]->is_featured
- Only showing the_date and the_excerpt for first entry in get_posts
- get_posts() using an array of post ids [closed]
- Get all posts with a certain meta key, except for one with specific title
- Array merging multiple get_posts throwing Undefined offset error
- Using get_posts, I need to use a combination of OR & AND relations
- How do I get posts by multiple post ID’s?
- setup_postdata() does not seem to be working?
- Regenerate Slugs From Title of Posts
- Why get_posts are only showing five posts (retrieved by assigning a category to them?
- WordPress get_posts by category
- Alternative to get_posts() due to multithreading cache crash
- Can I query custom meta data through WP_Query
- How to get current post ID in quick edit callback
- How to restore deleted pages/posts?
- get posts based on meta value of the author
- date_query not returning some posts in date range
- How to query serialized array by comparing greater than (>=)?
- Query all posts where meta value is empty
- Why favour the standard WP loop over iterating over (new WP_Query())->get_posts()?
- Query posts ordering by title, but ignore ” and special characters
- How to check a single number value against an array of meta_key values?
- Meta Query with date and time on the same Day before given time
- How to update single value in multi dimensional Post Meta?
- get_posts not honoring post_status
- get_posts only children from certain parents
- WP Meta Query for some meta (array) values
- meta_query with array as value
- use get_posts to get custom field data, but in one array
- Filtering custom post type query
- get_posts from post x(offset=>x) to end
- With get_posts(), how can I put a category as a variable
- How do I combine these 2 queries
- Increase the page size of the WordPress REST API
- Cache Get_posts
- get_posts() returns all posts rather than the ones specified with ‘post_author’ =>
- Query random post from different categories
- get_posts() excluding all children of a specific post/page
- `get_posts()` ignore my custom post
- excluding current post from get_posts
- How to query posts to include specific pages of one post type, and all pages of another post type?
- Only retrieve posts where post_excerpt has been filled out
- Can I use numberposts=-1 and offset together when using get_posts()?
- Ordering posts in get_posts
- Adding an array from a query string to a WP meta_query
- Better way to list links with different meta values using same meta key?
- Meta Query returns wrong number of posts
- How to get the post content from a category on my homepage
- get_posts() not working in functions.php
- Get posts by list of post IDs ordered by those IDs?
- Display post details by post ID
- What is the p parameter in a get_posts() parameter array?
- Delist entries in the_loop
- Inserting post content into pages when using custom taxonomies
- Output meta into arrays
- Get posts in between specific ID’s
- How to use WordPress Conditional Tags in get_posts foreach loop
- Don’t submit post if post title exists
- Turn get_posts as string into an array for use in theme admin options
- Hide gravity forms
- Why would get_posts be ignoring posts with 2-digit ids?
- Querying multiple values from a single key
- Order custom post type by custom field (created by PODS) via PHP
- get_posts( $args ) return empty data
- get_posts returns all posts
- Check if searched number is within the post meta value
- WordPress Random post (last 3 days posts)
- Fetching All Posts (200+) in a Category – Performance Issues?
- Can’t get Category link inside get_posts
- List all pages including archive
- How do I get only a certain number of images from a post (minus the featured image)?
- Yet another get_posts() in explicitly defined order problem
- List random posts on single page in the current category
- Divide the list into two columns (get_posts)
- WordPress & MySQL , problem with use many array in meta_query
- WordPress echoing content in seemingly random place
- How to use get_posts to filter against a single post id?
- WP get_posts meta_query using ACF repeater field
- Why set cookie from URL parameter doesnt work all the time?
- get_posts filter meta_query using ACF Checkbox
- How to get posts by meta value as multi-dimensional array?
- Is there a way to extract a single post better than using get_posts()?
- WP_User_Query Orderby Not Working
- Custom Category widget
- get_posts – check if custom field has content?
- Get Posts from Custom Meta Query
- Why does ‘meta_key’ return an empty array in get_pages
- Slow query when selecting with large meta query or post__in
- How to exclude posts with empty and non-existent relational custom field with meta_query?
- Use not custom fields in get_posts() meta_query?
- How to Retrieve Post ID of another page
- WordPress – List Sub Categories and Sub-Sub Categories, With Posts
- Sorting posts by specific order
- Sorting not working with get_posts
- posts_per_page – Repeats only first posts ‘post__in’ array
- WordPress extremely slow when using get_posts with multiple meta_query relations
- How do I have multiple metaqueries inside one wordpress query
- post__in select all custom posts and not the selected array of ids