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
- WordPress REST Create Post of Custom Type
- How do I programmatically add items of content to a custom post type?
- Slug for standard post post_type
- How do I create an archive page for standard posts?
- WordPress custom post type archive with description
- Remove parent from custom post type
- How to add post_type=value when editing that post type in the WordPress admin?
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- search suggest – filter post type
- How to delete all trashed item in one-go
- Trying to get custom post of a custom taxonomy
- Querying & displaying custom post type into an existent page [closed]
- wordpress lists similar type of posts in a custom post type
- list posts of two post types in a single template
- Sets post_parent in custom post type posts automatically based on cpt->page name
- Show the categories the current post has
- ACF – Retrieve custom taxonomy from a relationship field
- How to display “Trash” in my custom post type?
- Create loop from selected terms in ACF taxonomy field
- Sort custom posts by date and then by taxonomy
- Add a form in every post and save data in post meta
- Query custom post type that has a serialized relational advanced custom field value
- Sending current featured image to email
- Plugin Development using classes – Public & Private Callbacks
- Filter posts by their related field’s custom field
- If ACF Post Object post has custom taxonomy term…
- Custom post type order by post_title
- Tell wordpress to show a single page instead of an archive page
- minimize wp_query call to database
- Post display in separate page [duplicate]
- Some permalinks on Apache/localhost development setup return 404’s when set to anything other than plain permalinks
- Delete Post by User
- Include images from pages in wp search.php results in default wp search
- Only show current category post
- WordPress Contents Migration
- How to make post page unique and show it on home page?
- Custom Search not working
- Query Posts From Multiple Post Types
- WP Build-In Post selector for CPT
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- Post object GUID adding http:/