Support

Home Forums Event Espresso Premium EE4 and a Drop Down list of Events

EE4 and a Drop Down list of Events

Posted: October 10, 2016 at 12:43 pm

Viewing 5 reply threads


scaldwell

October 10, 2016 at 12:43 pm

Is it possible to dynamically create an event drop down in EE4? I see only EE3 stuff in the forum.

Thanks!
Shelly


Josh

  • Support Staff

October 10, 2016 at 1:46 pm

Hi Shelly,

Yes that’s possible in one way by making use of the WordPress wp_dropdown_function(). So for example, a very simple drop down list of events could be made by adding the following to your page, post, or widget template:

<h2>Events:</h2>
<form action="<?php bloginfo('url'); ?>" method="get">
<?php wp_dropdown_pages( array( 'post_type' => 'espresso_events' ) ); ?>
<input type="submit" name="submit" value="view" />
</form>


scaldwell

October 20, 2016 at 1:22 pm

Hmmmm…That didn’t work for me – but I’m looking into getting this working with Gravity forms so I’ll do some additional hunting. When I get a solution, I will post. THanks Josh!


scaldwell

October 20, 2016 at 2:21 pm

Joss will this solution: https://gist.github.com/joshfeck/fa7725952e9087c1a781

Pre-populate the event name so that when we get the results we know what class they were trying to sign up for? I would hope so, but want to make sure.

Thanks – this might be a better solution for us.
S


Josh

  • Support Staff

October 20, 2016 at 3:06 pm

Hi there,

It actually does not pre-populate the event name in the form, but if you’re using Gravity Forms (or Ninja Forms, it should not matter), the form entry will tell you from which event/post/page the form was submitted from, so you’ll have that information without adding any drop down list of events to the form.


scaldwell

October 20, 2016 at 3:59 pm

Ahhhhhh!! Ok. brilliant. Thanks Joss!

Viewing 5 reply threads

The support post ‘EE4 and a Drop Down list of Events’ 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.

Event Espresso