I would like to include some custom fields, because I need to include a “boat type” with the event.
the_meta() tag works in the single page, event overview etc.
But not in the widget, if I simply put “echo the_meta()” in the widget template I get printed out “Array”, and if I put “echo the_meta($event->ID());” i get this string: “switch_like_status: 1, 1, 1, 1, 1, 1”.
I tried to read the data in the widget template like you said with get_post_meta(), but it still doesn’t work …
My code: <?php echo '<li class="boat">' . '<span>Boat:</span>' . get_post_meta($post->ID, 'Boat', true); ?>
When you use $post->ID, WordPress will try to get the custom field for Boat for the current WordPress post (or page). Instead, you use the event ID, like this:
I haven’t run into any issues with using Advanced Custom Fields on Event Espresso events, but your mileage may vary depending on the active WordPress theme and if there’s another plugin adding any scripts to the editor.
Viewing 4 reply threads
The support post ‘the_meta() in widget’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.