Skip Navigation

[Resolved] Split: Using Types to create Events

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display ACF relationship posts

Solution:
You should create a custom shortcode and add it to your theme's functions.php file to get ACF relationship post.

You can find proposed solution, in this case with the following reply:
=> https://toolset.com/forums/topic/split-using-types-to-create-events/page/3/#post-1071238

Relevant Documentation:

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 37 replies, has 3 voices.

Last updated by keithW 6 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#1070420

Minesh,

Thanks for continuing to work on this with me. It looks like we are close but there is still something funky going on.

Goto hidden link. You can see that the first event's details aren't being loaded however the data-capabilities are. The second event's details display but the data-capabilities do not. Seems like something within the shortcode function is causing the problem but I can't figure out where.

#1070421

And it's odd because the staging version that you worked on is different.

hidden link

Neither of the events load their details but both load in their data-capabilities.

#1071238

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - I've adjusted the code again as given under:

function func_get_practice_areas2( $atts ){
	global $post;
	
	$post_id = $atts['pid'];
	$posts = get_field('practice_areas',$post_id);
		
	if( $posts ):
		$pa_title = '';
		foreach( $posts as $p):
				$pa_title = $pa_title.get_the_title($p).' ';
		endforeach;
		
	endif;
	
	return $pa_title;		
}
add_shortcode( 'acf_practice_areas2', 'func_get_practice_areas2');

I see the posts just loads fine with all capabilities the post is assigned to:
=> hidden link

#1071524

Minesh,

Excellent... that seems to be working now. Thanks for all your help!

Moving onto the next question.

We need to add events to the practice area pages but only events that are associated to that area. Inside Views there's no way to use the ACF relationship field in the Query Filter so how would we go about accomplishing this?

I need to query the events CPT, get the events that are associated to the Practice Area via the ACF relationship field and then display the events that are upcoming via the RFG's event date.

#1071550

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - as your original issue is resolved which is reported with the original query.

Before this ticket become a ten page story, as per our support policy, we entertain only one question per ticket. May I kindly ask you to open a new ticket with your each new question. This will help other users searching on the forum as well as help us to write correct resolve ticket summery.

Additionally, I'm also totally opposite timezone, so once you create new ticket, you will get replies frequently from supporter working in your timezone.

Thank you for understanding and glad to help.

#1077533

Minesh,

We've run into one small problem that I'm hoping you can help with.

Goto hidden link and click the button to View Past. Scroll to the bottom of the page. There are several instances where the content is empty but a row is displaying. Troubleshooting this a bit, it looks like these are events that were trashed but the RFGs are still being found and displayed in the list.

How can we make sure only active events are displayed here?

New threads created by Minesh and linked to this one are listed below:

https://toolset.com/forums/topic/split-split-using-types-to-create-events-only-show-active-events-with-rfg/

#1078622

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - we should not continue like this. The ticket has been already become long.

I split the ticket to handle your new question with new ticket. Please feel free to close this ticket.

We will continue with new ticket here:
=> https://toolset.com/forums/topic/split-split-using-types-to-create-events-only-show-active-events-with-rfg/

#1078719

Thanks for helping fix the issue!