One problem here is that you have written post-type
with a hyphen when it should be with an underscore, like this post_type
.
So, this should get your post data back:
$args = array(
'post_type' => 'leaders',
'meta_query' => array(
array(
'key' => 'topics',
'value' => '1773',
'compare' => 'LIKE'
)
)
);
$test = get_posts( $args );
Related Posts:
- How to I add count of custom posts listed in a post as a prefix to its title
- Meta Query “IN” doesn’t work with ACF checkbox filter
- List events by month
- How to get only one category of custom post type?
- Show ACF field from custom taxonomy and display on the single template
- Change message given when deleting post from custom post type
- Link users to a custom post type
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- get_posts of Custom Post Type AND Custom Taxonomy
- WP_Query to select custom post type with Advanced Custom Fields (ACF) date
- Stuck in Order by more then one
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- How to update post meta on uploaded image from a custom form?
- Displaying custom field according to date
- Recoverable Fatal Error – Object of class WP_Post could not be converted to string
- Create short URL with auto 301 redirect
- Is it possible to use array_walk() to append terms to an array of posts?
- Query entries from custom post type in an ACF flexible content field
- Group by custom field value (start and end times)
- Fetch data from two custom post types and create multidimensional array for output to html table
- Custom front-end form for adding post – Category problem
- count & sum the value of custom field of the author post in dynamic posts
- Grouping custom wordpress post types by acf value
- I’m having trouble with Related Product “tax_query” ‘terms’ value
- WordPress – display relationship between blog posts and custom posts
- Custom sorting in post columns by ACF Pro Select Field
- Load info from customposttype into template page
- CPT: execute code after load if parameter is set
- ACF Post Content Not Being Searched
- Display related post content and custom field content
- Group/list/sort custom post type posts by date in tabs from acf datepicker field
- Can’t pick up a field created with Advanced Custom Fields
- Custom post tag images not displaying with ACF
- Get month and day from a Date Picker custom field
- using ACF datepicker to filter posts on a page
- Custom Post-type not returning the right child_of
- Getting ACF relationship field information
- Add Category names to post lists of custom post type
- How can I remove the “Add New” button in my custom post type?
- Get Custom Taxonomy ID within loop
- Filter a custom field based on selection of another custom field (ACF) [closed]
- Categories under custom post types doesn’t show properly
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- How to query custom post type by term?
- Quickest way to get last or oldest post date – WP Query
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Rewrite WordPress URL to show CPT meta field data
- Adding custom tables to WordPress
- What’s the difference between same wp functions get_posts(); functions in different form?
- how to check if custom post type column already exists?
- Display all post titles of current post type
- Can I list a custom post type within another custom post type in the admin area?
- On update or create post redirect to current post position in list
- How to display custom WP menus?
- Multiple (two) category postings on the same page.
- Custom Post Types vs. Advanced Custom Fields (with Repeater Field add-on)
- How can I group posts by months and years?
- Saving fields in a drop-down in WordPress
- Conflict between wp_list_pages and get_posts – list pages not displaying
- Assigning a category to a custom post type in WordPress
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- set_query_params using custom params defined in functions file?
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Show message when query has no posts
- How to define the template for custom posts?
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- How to export custom post type with ACF to individual file with automation?
- Can’t pull posts of a Custom Post Type based on the custom taxonomy of the CPT
- Creating on-page options for Custom Post Type
- Query custom posts of logged in user only
- Post type Echo code is repeating on homepage
- How can I increase the post count for custom post types only?
- How to query custom post types with multiple keys?
- How do I call the custom Post Type name and permanent link to my php file?
- How can i show ACF in post excerpts
- Is it possible to hide nav menu items only when they are page titles (on specific templates) but not on the dashboard?
- How to display posts with plugin (advanced custom fields) field groups?
- when looping through custom post data not appearing
- Getting a Post ID to show its content in a Popup
- ACF meta_key and meta_value break loop
- search results to show individual ACF fields from inside custom posts
- Disable Sidebar on certain pages
- Videos Post Type with Custom Filters
- Show parent category and subcategory once in while loop
- Use output of wp_dropdown_categories($args)
- Values show up in custom home page but not in custom post pages
- Custom 404 redirect for a luddite
- Show tags of custom post types in WordPress
- How can you use a page for a custom post type?
- WordPress get all post with like in terms [duplicate]
- How to load custom post type plugin after acf options page (or get settings from there another way)?
- can’t see categories in appearance-menu-categories
- wordpress form processing to custom post type not working
- $post breaking container loop
- WordPress custom field images not getting inserted into array
- Meta-Box to add multiple items one at a time and on publish save all
- Values inside a custom field to determine which category posts to display
- Posts without featured image using other post’s featured image
- Retrieve a post with its ACF repeater fields in wordpress
- Two custom post type relations