Hiya,
You shouldn’t need to do that at all – you should just be able to use the #_ATT{key} placeholder.
Thanks
Hi philipjohn,
Thanks for the quick reply.
I’m not quite sure that this is what I’m looking for.
I need the post_id of the actual event. Or can I asign the post_id to an attribute? Can you show please how?
Cheers
Do you need to use that PHP in the template for some reason, rather than use the standard Events > Settings > Formatting > Default single event format box?
If not, as Phil says, you can just #_ATT{key} in the formatting box – where key if the name of the attribute you want to display.
No I don’t need php at all.
The reason is: I converted the custom post event into a wordpress post with Post Type Switcher plugin. It works well but the problem is that the event related attributes like date, location eg aren’t switched to the post because they are custom attributes.
I try to get this information via the post_id back. Any idea how else I could manage that? I hope I explained myself reasonably.
Cheers
Custom attributes are saved in the database the same way as custom fields so you can use the same functions to get the data:
http://codex.wordpress.org/Function_Reference/get_post_meta
You should be able to access the post ID in the normal way:
$post->ID
Thanks caimin_nwl,
but how would I put it in the shortcode to display the event details like:
[event post_id=”xxx”]#_EVENTDATES at #_EVENTTIMES[/event]
Maybe I’m missing the obvious.
Thanks for taking the time.