You should ACF
meta_query to filter custom post type by custom field.
https://www.advancedcustomfields.com/resources/query-posts-custom-fields/
basic example:
$posts = get_posts(array(
'numberposts' => -1,
'post_type' => 'products',
'meta_key' => 'price',
'meta_value' => $value
));
Related Posts:
- How to change “Draft” string for status of custom post type to “Unavailable”?
- How do I filter the excerpt metabox description in admin?
- How to get Custom Post ID by adding filter to child theme’s function
- WordPress sort search results by custom order
- WooCommerce sort products by the actual product width(not the shipping width)
- How to create a custom search for custom post type?
- what is the correct way to compare dates in a WP query_posts meta_query
- How do you use a CPT as the default home page?
- Can a custom post type have a Parent Page?
- don’t publish custom post type post if a meta data field isn’t valid
- Media library – Limit images to custom post type
- Why are the comments disabled by default on my custom_post_types?
- Linking Two Post Types
- Filter for “get_post_type_archive_link()”
- Custom Taxonomy with Custom Post Type Finds No Posts
- Best Way to Create a List of Musician Gigs in WordPress
- Filter by custom Field for Custom post type Admin Listing
- add_rewrite_rule and custom variable
- Remove wpautop from all posts/pages except my custom post type
- Remove date and category filters when editing custom post types
- Want to filter only parent post in admin area
- Restrict categories to a custom post type
- Filters post in admin with dropdown select, custom post type
- Get the post children count of a post
- Programmatically adding posts
- Keep main articles and author blogs seprerate, News / Magazine like site
- Custom Post Type, Saving Multiple Checkboxes
- How to create an advanced filter search?
- register_taxonomy and register_post_type does not work [closed]
- Custom post type and body_class: Remove “blog” class
- Setting posts per page in query_posts
- How to insert content from another Custom Post type into Post?
- Get rewrite slug of custom post type in template
- Placeholder in HTML editor text area?
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- How to integrate video slide using custom post types?
- Hide parent categories when clicked, and show it’s childs
- Time based access control of custom post types – what is good approach?
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- Show titles, date of all posts on single category page
- Filter hierarchical custom post type admin page by parent, and include children & grandchildren
- the_content filter on some post types only not working
- A form that can save/edit after first input
- Allow users to create posts without logging in?
- Custom filter function not working with Custom post type
- Redirect to another page using contact form 7? [closed]
- Categorise Custom Post Types
- Custom URL redirect in WP
- Remove Quick edit for custom post type?
- attach CPT data to a taxonomy
- Creating a non-hierarchical Taxonomy that behaves like categories
- Problem with Apply Filters on URL in meta box filed of custom port type
- Separate Content from gallery (custom post type)
- Custom Post type content within a slider
- Displaying a custom post type using get_template_part into a specific layout
- Displaying a list of Contacts
- Different videos for different posts
- WordPress as a frontend website for iOS app [closed]
- How can I make custom static widgets/areas on my homepage?
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Add Class according to the order of appearance
- Change Custom Post Type singular_name through function/filter
- custom comment fields on CPT
- Add Class After 4th Post
- Custom taxonomy not saving correctly
- show most viewed posts of last days by link?
- How set template for “custom post type” individual post
- Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- How do I ensure that post_type and Taxonomy use the same slug?
- Setting Parent Page to Post
- Question about link two types of data in wordpress
- Custom Form / Search with Custom Post Type Data
- Best way to fix bad count on All | Mine | Published
- Search for custom field input of a custom post type in ajax live search
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Custom Post Type and Structure Question
- Filter in Custom post type to find the parent post
- Remove plugin settings from post creation page for a user role
- Custom post type defaults to index.php for archive page
- customize Dokan multi vendor: how can i set every Dokan as child of another dokan?
- Add content to wordpress edit.php page
- My post loop needs to have 8 different post templates
- Automatic Set Category For A Custom Post Type
- Publish metabox postition?
- Need folder for CPT templates for eg: single-{post_type}.php
- Permanent Custom Post Type
- Add filter button to custom post type in admin area
- Grouping and paging CPT events by month with custom field date
- Child Theme problems
- Exclude Custom Post Type from shared Custom Taxonomy
- Sort by Custom Post Type (Multiple Loop)
- Selecting which pages to display custom post type on using checkbox
- Displaying information from Custom Fields in template with Types?
- Collection of fields in a single post
- How to filter posts by categories?
- 2 language CPT content
- Is There A Way To Add Another Field To Custom Post Type (Not Custom Field/Meta)?
- Exposing custom fields to the user in custom type post
- show posts under custom post type with same autj