• Resolved Matt Scheidler

    (@matt6303)


    I have added a ACF “file” field to the Events post type, to allow upload of an event flyer (PDF or JPG). How can I display a link to the file in the List view?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You could create a custom placeholder. Here’s a tutorial on creating custom placeholders: https://wp-events-plugin.com/documentation/tutorials/create-a-custom-placeholder-for-event-formatting/

    If your ACF field is called “flyerfile” then the following code would create the #_FLYERLINK placeholder.

    add_filter('em_event_output_placeholder','my_em_placeholders',10, 2);
    function my_em_placeholders($replace, $EM_Event, $result){
    if( $result == '#_FLYERLINK' ){
    $replace = '<a href="'. get_field("flyerfile", $EM_Event->post_id, false) . '">Event Flyer</a>';
    }
    return $replace;
    }

    You can add the #_FLYERLINK to the event list format by going to Events Manger settings then in the Formatting tab enable “Advance Mode” and “Super Advance Mode” then in the Events section you can add the placeholder to the default events list format.

    Thread Starter Matt Scheidler

    (@matt6303)

    Thank you very much! This got me going in the right direction. Defining a new placeholder was the key. I have this in place now. Thanks for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.