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
- WordPress duplicating posts from single loop
- Blog page showing same content as homepage
- Advanced Custom Fields: Post Object – Not returning data [closed]
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Combine query_posts() and get_posts() into single query
- Using several custom fields as custom post title
- Custom Post Type without an archive page
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- Get rewrite slug of custom post type in template
- Show Different Header on a Specific Post ID
- “add_post_type_support” with Custom Post Type & ACF
- Get Post Primary Category
- Custom Post type with ACF in REST API, how do I get those values?
- Are there sub-systems in WordPress that would employ data structures beyond CPT that a `get_posts` won’t be able to catch?
- Weird problem happening with custom taxonmy when creating/updating posts
- ACF simple text field value not showing
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Post Object Filter by Custom Field, not title (ACF)
- Shortcode for display posts on home page show only one post
- Custom Post Types not showing, custom WP_Query
- Admin notice not displaying
- Can’t get order_by meta_value_num to work properly
- Create custom post type on successful woocommerce order [closed]
- Rewrite WordPress URL to show CPT meta field data
- Create 3 Level Relations with ACF and WordPress
- Custom Post type and Custom Field WP_Query
- Display multiple custom post types and sort them chronological by one of their fields
- Adding custom tables to WordPress
- WordPress count child posts of each parent custom post type and use in json array for google maps jquery plugin
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Very Slow Page – How to Optimize # of Queries?
- Dynamic page outside WordPress
- Using wordpress template tags within an array
- Getting the URL of the parent page
- Custom query to filter posts that have current post as a taxonomy [closed]
- Multiple ACF Repeaters within a Custom Post Type
- How to change post featured image using a custom field of category?
- Custom post type permalink returns bad url
- Return the thumbnail meta data for getter and setter
- How to display selected taxonomies by their parent
- Validate custom fields before save using WordPress Rest API
- Custom Field Order by Last Name and First Name
- Pagination for custom php code
- What’s the difference between same wp functions get_posts(); functions in different form?
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- Custom Post Type Loop throws 500 error when used in widget
- how to check if custom post type column already exists?
- How inefficient is it to use a Custom Post for 4-5 sentences & pull all to 1 page?
- Get posts from a custom post type by child categories of a parent category
- Received nothing after executing AJAX post function
- How to make sure content doesn’t display if selection is empty
- Custom Post-Type not in admin menu
- get the custom post type title/name
- Page vs Custom Post Types Differences/Issues
- Custom fields vs. Custom post types for a Portfolio Website
- If post has custom field then display css-class
- Push metadata in array
- How to customize a permalink (URL) structure?
- Troubles with saving metabox
- Retrieve value of a category’s custom field
- CPT + CMB2: data not displaying for only first post in loop