Hello. Thank you for contacting the Toolset support.
As I understand - you have post type "Person" and "Agenda Item" and you created the post-relationship person-agenda-item between those post type.
Now - I see you have the following page where the solution you applied is not working.
- hidden link
That means you are on currently "Agenda Item" single post but parent is "Person". You are using:
'related_to' => $post->ID,
- But that is current post ID that means of current Agenda Item post.
You will have to get the parent post (Person) ID.
Assuming you have one-to-many post relationship between your post type "Person" and "Agenda Item", what if you try to use the following modified code:
add_action( 'elementor/query/person-agenda-item-query', 'atc_custom_query_02', 10, 2 );
function atc_custom_query_02( $query, $widget ){
global $post;
/// get parent post ID
$parent_id = toolset_get_related_post( $post->ID,'person-agenda-item');
$query->set('toolset_relationships', array(
array(
'role' => 'child',
'related_to' => $parent_id ,
'relationship' => 'person-agenda-item'
)
) );
}
I need to review your relationship structure and data.
Can you please tell me on what page and within what section of that page you want to display what content and send me admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.