Events Manager
[resolved] Custom Field needs PHP query --> can't figure out how (7 posts)

  1. Nicky-Walraven
    Posted 1 year ago #

    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.


  2. Nicky-Walraven
    Posted 1 year ago #

    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.

  3. Philip John
    Posted 1 year ago #


    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.


  4. Nicky-Walraven
    Posted 1 year ago #

    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!

  5. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

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


  6. Nicky-Walraven
    Posted 1 year ago #

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

    <img src="http://www.metalfrom.nl/wordpress/wp-content/uploads/2014/02/printscreen.jpg">

  7. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    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:


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic