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)
- What does this PHP function code mean? [closed]
- 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?
- single-{$post_type}-{slug}.php for custom post types
- Row actions for custom post types?
- Can a custom post type have a Parent Page?
- Restrict custom post type to only site administrator role
- remove custom post type permalink
- Creating an Image-Centric Custom Post Type?
- Saving Taxonomy Terms
- Filter by custom field in custom post type on admin page
- don’t publish custom post type post if a meta data field isn’t valid
- How can I remove the “Add New” button in my custom post type?
- Media library – Limit images to custom post type
- Correctly delete posts with meta and attachments [duplicate]
- How do I append multiple taxonomies to the URL?
- Why are the comments disabled by default on my custom_post_types?
- Sort search results by post type
- Linking Two Post Types
- Prevent pre_get_posts filter on specific post type
- How to force one column layout on custom post type edit page?
- How to set a default format for a custom post type?
- Multiple post types – share same ReWrite slug?
- How to order posts of a custom post type by date DESC in dashboard Admin?
- How to remove Filters from post admin page?
- Custom Post Types on Category Pages
- Custom sortable columns ordered by meta-value?
- Setting Default Category for Custom Post Type Upon Autosave
- Creating “static” taxonomies to choose from, inside custom post type?
- WordPress Custom Post Types with a page as a parent?
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- How can I filter posts by post_parent in the admin?
- Search multiple custom fields by using meta_query
- Custom post status not working
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- Setting up custom post type archives in WP3.1? Any luck?
- Filter for “get_post_type_archive_link()”
- How to correctly get post type in a the_title filter
- How to Remove Certain Screen Options and Table Columns from post type in wp_list_table?
- Custom Taxonomy with Custom Post Type Finds No Posts
- Best Way to Create a List of Musician Gigs in WordPress
- How to add a CSS class to every image in a Custom Post Type
- Best way to filter featured image text for a custom post type?
- How can I get next/ previous post links to order by a filter (by the last word of the title)?
- Get custom post type by category in a page template
- How does one delete orphan custom post type?
- Associating an “author” with a custom taxonomy
- Redirect after deleting post and keep track of pagination
- WP 3.1 – archive pages for custom content types possible now without a plugin?
- Filter by custom Field for Custom post type Admin Listing
- Admin Post Update Redirection to Posts Screen
- Most efficient way to search for values from CPT in Post content
- WP Admin default view mode for Custom Post Type
- add_rewrite_rule and custom variable
- modify all posts of a category to “no comments allowed”
- TV Show database – Best way for structuring it?
- Add custom field to media attachment image attribute in post editor
- post_type_link filter causes 404 on the CPT page it’s used on
- Remove wpautop from all posts/pages except my custom post type
- Remove date and category filters when editing custom post types
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- How to not allow custom roles to edit published custom post types?
- Delete all the custom post types when deleting user
- Localization For Two Different Regions/Domains with the Same Language
- Correct way to use a form to to filter custom posts by taxonomy terms?
- Exclude custom function content from certain pages
- Assign Page Template Within A Custom Post Type
- Title_save_pre – Simple problem that u know for sure
- Showing current taxonomy terms
- Add comments meta fields to comments metabox on post edit screen
- Filter get_categories() for taxonomy term in WordPress
- Removing Image Sizes for Custom Post Type
- Debug output during filter execution doesn’t work
- White screen error for a custom theme
- How to override parent theme function through the child theme [closed]
- Custom Post Type with Custom Title
- Ajax filter with custom taxonomies
- automatically create taxonomy with same name as post title
- Filter posts with ajax form and checkboxes
- Multiple post types in archives (filter?)
- How to add a select menu to this metabox code?
- Query posts by custom post type and custom taxonomy
- Image size filtering in Media uploader according to custom post type
- How to remove CPT comment feed from head?
- How can I remove categories in menu in custom post type?
- Custom Taxonomy conditionals
- remove_action conditionally for Custom Post Type
- Search results ordered by custom post types are not grouped
- Single Page WordPress CSS and JS links
- How can I customize “Pages” admin (edit.php) and “Edit Page” admin (post.php) for bulk edit of custom content type?
- Unable to filter on field on edit.php page
- Assigning a role to a specific custom post type (and ignoring other post types)