Posted: February 17, 2017 at 3:05 am
|
Hello, I’m trying to create a custom template page for displaying event_people post type. I have successfully created a template page, my only challenge now is to create an instance variable of the person post which contains all the event_people post details assigned to the user including the categories and person types that user belongs to. For example $event_person = event_esspresso_instance_of_person ($person_ID); Also, how can i get the country, state of an event_people post type using the state & country ISO code? Thanks alot for your help |
Where are you outputting the details? You may already have access to the info depending on what it is your doing.
Where would $person_id be coming from? You can pull an instance of a ‘EE_Person’ using:
I’m not sure I follow what your doing here, where are you pulling the personal state and country name from? If you have an EE_Person object you can use the method available on that object to output the details you need. For Example if you used the above code
If you don’t have it already, I recommend installing Kint on your dev site: https://en-gb.wordpress.org/plugins/kint-debugger/ You can then do |
|
|
Thanks alot Tony, your reply was super helpful. The only challenge i have now is, how can I retrieve ALL “Person Category” and “Person Type” for a particular person? For example, maybe something like:
Thanks. |
|
And also how can i retrieve all events (upcoming) a person is assigned, and also the roles they’ve been assigned to in each event? |
Hi George, You can use the get_the_terms() function to list the custom taxonomy terms (role for each event) for the people post type: https://developer.wordpress.org/reference/functions/get_the_terms/ Then you can re-use the loop from the People add-on’s /public/templates/content-espresso_people-details.php template. |
|
The support post ‘EE People Add-On Custom Template Page’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.