• Resolved rmz65

    (@rmz65)


    I have used PODS to create the possibility to add performers to the events, because to me that is one of the biggest missing items.

    I am able to add code to the event-single.php file, which will then show me all performers for this event.

    But this means I need to format the output in this file, while I want it to be part of the template system.

    So, how can I change this sql-code into a conditional placeholder? I went through the events manager documentation but that is not really clear about what to do.

    This is the code I’m using in case anyone is interested.

    function show_performer() {

    //get Pods object for current post
    $pod = pods( ‘event’, get_the_id() );
    //get the value for the relationship field
    $related = $pod->field( ‘related_performer’ );

    //loop through $related, retrieve all performer names and links to detailpage
    // Check if at least one performer is linked to the event
    if (!empty($related)) {
    // There is at least one performer
    foreach ($related as $rel) {

    $performer_name = $rel[‘post_title’];
    $performer_link = $rel[‘guid’];

    echo($performer_name.’:’.$performer_link.'<br/>’);
    }
    }
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Here’s a documentation on how to create your custom conditional placeholders: https://wp-events-plugin.com/tutorials/creating-conditional-placeholders-for-events/

    Thread Starter rmz65

    (@rmz65)

    Hello.
    I know of this document, but that is not really clear on the how and where.

    Also I’m not sure this is still up to date. When I install the plugin and add styles to an event, I keep getting “none” as a result on the frontend.
    The backend seems okay, it shows the styles I selected, but it looks like something may have changed which broke the functionality, which makes the documentation less useful.

    Hello,

    Those documentation are updated. You’ll need to have some knowledge on PHP and WordPress hooks on how to make them work.

    You could always use PHP commands like var_dump or print_r to echo arrrays/strings/objects to test if you’re getting the right output.

    Currently We’re very limited in terms of custom coding. https://eventsmanagerpro.com/support-policy/ and based from your code it’s from another plugin which We’re not familiar with. I think it would be better to approach the plugin developer as they are more familiar with their code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Q: how to create conditional placeholder from sql function?’ is closed to new replies.