Below is the updated code to fetch posts, please check is that helpful:
$documents = get_posts(array(
'post_type' => 'post',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'our_people_author', // name of custom field
'value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234"
'compare' => 'LIKE'
)
)
));
Related Posts:
- How can I add dropdown widget/box to admin post page?
- Meta Query “IN” doesn’t work with ACF checkbox filter
- List events by month
- Limit Authors to their Own Posts on front-end excluding admins
- Show ACF field from custom taxonomy and display on the single template
- Change message given when deleting post from custom post type
- I am having a problem with form updating/editing WordPress post on the frontend
- WP_Query is printing out only one post when posts_per_page is set to multiple
- Link users to a custom post type
- Blog page showing same content as homepage
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- get_posts of Custom Post Type AND Custom Taxonomy
- If post has custom field then display css-class
- I would like to have different styles for my posts based on the content of each post
- WP_Query to select custom post type with Advanced Custom Fields (ACF) date
- How to update post meta on uploaded image from a custom form?
- Displaying custom field according to date
- Redirect to another page using contact form 7? [closed]
- Create short URL with auto 301 redirect
- Batch Extract Date from post title and put into ACF custom field
- Query entries from custom post type in an ACF flexible content field
- How to add new post using a form to categories when categories are using as menu
- How to set the mainpage of a custom post type?
- Different post title, keywords and description
- meta query not retrieving posts
- Template code to split a post and print a custom field?
- Fetch data from two custom post types and create multidimensional array for output to html table
- redirect after submiting post for review
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Custom front-end form for adding post – Category problem
- Is it possible to get the specific content on the search page?
- Why is my custom post content only viewable when signed into WordPress?
- count & sum the value of custom field of the author post in dynamic posts
- How to change Elementor Template for Single Page Post on Load
- Grouping custom wordpress post types by acf value
- open custom post type in popup window instead of page
- How to display posts with plugin (advanced custom fields) field groups?
- Custom sorting in post columns by ACF Pro Select Field
- Load info from customposttype into template page
- wp_post_delete is deleting all offices
- Adding specific custom fields (images) to post excerpt
- News post with multiple permalinks? When opened from different page
- Custom Post By Category
- How to get the posts that my following users are liked?
- 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
- Featured image in custom post is being disabled
- Can’t pick up a field created with Advanced Custom Fields
- Why isn’t my custom post type using the corresponding custom post template?
- 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
- Styling first post using Advanced Custom Fields
- How to hide home title on pages and posts?
- Getting ACF relationship field information
- How to I add count of custom posts listed in a post as a prefix to its title
- How to automatically update ACF field value every year?
- WP_Query search posts by custom post type and custom taxonomy
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- get_queried_object error How to show post count by month in the taxonomy page
- Check Title Unique Or Not and If not error message and dont save
- Dynamic Custom Post Type Plugin
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- How to filter out post type meta?
- How to make in WordPress admin panel sortable column for the custom field, that count the number of page impressions?
- Query Custom Post Types by date (custom field) range
- How to filter the taxonomy terms based on another taxonomy term
- Remove parent from custom post type
- CPT’s archive and single page not working [closed]
- Display custom field of specific post where post title matches variable
- Conditional to modify query results
- How to create A-Z index listing for custom post types?
- How to make post sticky in the admin page?
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- get_template_part for custom post type content not working
- Remove All, Published and Trashed Post Views in Custom Post Type
- How to replace custom post type slug with an ACF value?
- Output custom post shortcode. Help spot the error.
- Loop on front-page.php
- How to count custom post types with conditional operators
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Why my custom post posts aren’t showing (404 error / page not found)
- Automaticly add slug to posts
- How to post twitter like updates on wordpress
- Show Two custom Post type and their posts on category page
- How to create an array for a CPT post ID to use in an IF/WHILE statement
- WP Query to displaying date and posts for that date?
- GravityForm: Populate Dropdown with custom post type [closed]
- Return array of categories to php function for current post
- Trying to edit the single page from a Custom Post
- How to Submit Post Via cURL & PHP
- How to get all posts except for one post from a certain custom post type?
- Create a random unique 6 digit number as custom field for custom post type
- count_many_users_posts except current logged in user?
- How to output wordpress custom tags separated by comma?
- How can I show a custom post type for users in the authors.php file?
- Remove duplicated values from a loop