On single post, try something like this:
$author_id = get_the_author_meta('ID');
$people = get_posts( array(
'connected_type' => 'people_to_user', // replace with whatever
'connected_items' => $author_id,
'suppress_filters' => false,
'nopaging' => true
) );
Now $people[0]
references the first (and only) author related to the post you’re on. So $people[0]->ID
can be used to get the various bits of content, thumbnail, custom meta, etc.
Related Posts:
- Creating relationships between multiple content types [closed]
- How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
- Ordering Post 2 Post admin meta box by meta from CPT
- Allow User to Edit Page Based on their Email
- Getting Post ID from slug during init
- Connecting a taxonomy with a post type
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- Adding a Custom Field to be used by Posts 2 Posts
- Posts 2 Posts plugin: best way to change connection field value?
- Creating connections programmatically with common fields on CPT’s
- Posts 2 Posts: query connected — orderby problem
- How to display value of custom fields in page
- Create a ‘single’ page for a Custom Post Type
- Are custom post types lost when the theme is changed?
- Change the order of columns for a custom post type on the admin list page
- How to customize post edit notices
- Forcing all posts associated with a custom post type to be private
- Reason action hook won’t work with update_post_meta from frontend form? Alternative?
- if && problems with transition_post_status
- Custom Post Type Query multiple Taxonomy Terms
- current-menu-item not working with custom post type
- Taxonomy Url with Custom post type prefix re-write rule
- Add 32×32 icon to custom post type index page
- wp_nav_menu() mark current item ancestor of custom post type
- Filtering by Post Meta Custom Fields – Performance
- Custom Post Type without an archive page
- WordPress count child posts of each parent custom post type and use in json array for google maps jquery plugin
- Copying existing posts after new post type has been added
- wp_get_post_terms on custom post type with custom taxonomies returning an empty array
- get_category_parents for custom post type taxonomy
- register_post_type name character limit
- Possible to add different google analytics in custom post type?
- Registering post type doesn’t show results on front-end
- How to do WP_Query with two meta fields with orderby clause
- WP CPT template not found when another CPT is active/public = true
- Custom query at top of archive search page, arguments are overridden
- next/previous links on custom post single a little screwy
- How to change custom post type position from backend
- How to make permalink structure %category%/%postname%/ work for custom post type?
- Targeting custom post type
- Add the post type to the title of the page
- Using wp_localize_script to get data from cpt and pass it to maplace-js locations
- Getting Un Wanted Gallery Shortcode In The Page on Loop
- Variable not working in WP_Query
- How do I know if a rewritten rule was applied?
- How to handle new post from API request?
- Getting custom post type info using get_adjacent_post
- How to reorder categories for Custom Post Type
- Filter result of Custom Post Type using meta_query with ACF
- How to properly set the rewrite rules for this case?
- Custom sorting in post columns by ACF Pro Select Field
- wp_post_delete is deleting all offices
- How to disable the editing of the time and date published for particular post type only?
- Sort custom post archives by a meta value from a different custom post type?
- current-post-parent for custom post type
- Use WP Title instead of custom field to call
- Navigation not working for custom post type pages
- WordPress page not showing up – replaced with last 10 posts?
- Displaying image instead of post label in wordpress
- When I select a page for frontpage, it is blank
- Meta Box not being added in plugin
- Problem with ‘save_post’ hook not running
- Custom post type taxonomy not sorting correctly
- Get All post that is in table
- How can I retrieve the slug for a custom post type via name?
- Capability to read user’s own draft post of CPT
- WordPress search results
- Trying to display posts by authors in with specific user meta
- Create scroll of custom post types
- Menu that shows months and filters posts to show only posts from that month and shows posts as sub items
- my custom_post_type does not appear in my web page…how?
- Multiple posts selection [closed]
- How to make a non-public post on wordpress approval?
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- Filter page ID outside the loop and order
- the_post_navigation in single page with multiple taxonomies
- Url rewrite with custom post type and taxonomy
- wordpress category form fields in popup
- How can I show posts with the same tag?
- How Do I Add a Custom Post Type URL to Content?
- Paginate yearly archives for a custom post type
- Custom taxonomy meta fields
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- is therer any wordpress function to retrieve a specific html element from post content
- How to rewrite custom slugs that follow my rules
- Problem with shortcode
- display related posts based on the PAGE TITLE
- Custom Post Types Permalink
- What is the best way to relate different custom post types?
- Custom Sort Order for Custom Post Type Taxonomy
- Load posts via AJAX without draft status
- How to add categories to a custom post type using wp_insert_post($new_post);
- Modify permalink of CPT archive to support two taxonomies
- Why does wp_generate_uuid4() timeout?
- Delete Term from Custom Taxonomy using wp_delete_term isn’t working
- WP Query – Can’t get posts with specific taxonomy
- Allow child pages with the same base as the CPT slug
- upload image with rest API to the media library
- WordPress post objects in one parent post object
- Custom Post Type slug has the same Redirection entry