Support » Plugin: Events Manager » Custom Field needs PHP query –> can't figure out how

  • Resolved Nicky-Walraven


    Hey guys,

    I’ve been struggeling with this for a few days, can’t figure out how I’m supposed to do this.

    I have a custom field called band_naam wich is a custom field made with the custom fields plugin; and is a relation field. It grabs post-titles (based on a custom post type) and with the following PHP code creates a clickable link to that post.

    I get that I need to implement the PHP somewhere (other than in the events-manager settings page) but I can’t gigure out where. I might have to create a custom template but I wouldn’t know where to call it.

    I have average PHP skills, if someone could point me in the right direction that would be great. The ammount of files in EventsManager plugin is overwhelming.

Viewing 6 replies - 1 through 6 (of 6 total)
  • more info:
    I’ve added the _#ATT{band_naam} to the single-event box in the events-manager settings page; It outputs something, I’m guessing the post-id’s of the post called for by the field.


    It would be better if you could tell us what you are actually aiming to do, so we can provide suggestions on the best course of action.


    Hiya Phil,

    I have an EventForm which I use for bandnights. I want to add the performing bands to it. Those bands have a band-page on my website, which is a custom post type (called band).

    I’ve added a custom field to the event custom post-type with Advanced Custom Fields plugin. This allows me to create relations between various posts based on the custom fields. I allready use the band_naam field on multiple pages. For instance: it links the cd-reviews by that band back to the band-page.

    I want the events to link back to the bandpage as well and vice versa

    Hope that makes it clear!

    Plugin Support caimin_nwl


    NetWebLogic Support

    Ok, so you just need to construct a URL that follows a format something like the one below?{band_naam}/

    it seems that easy, but just putting _#ATT{band_name} gives this output

    <img src=””>

    Plugin Support caimin_nwl


    NetWebLogic Support

    There are a couple of ways to do this. One way would be with code like this:

    global $EM_Event;
    echp $EM_Event->output(_#ATT{band_name})

    Because custom attributes are stored the same way as standard WordPress custom fields / meta data, you can also use get_post_meta:

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom Field needs PHP query –> can't figure out how’ is closed to new replies.