Home Forums Event Espresso Premium How to customize Archive page with filter based

How to customize Archive page with filter based

Posted: July 29, 2019 at 8:30 am


July 29, 2019 at 8:30 am

I have need help to fix list pages layout like with filter, Please review below screens:

Filter : Categories, Locations, Date


  • Support Staff

July 30, 2019 at 8:59 am

Hi there,

If you are using our models to pull the events into that custom listing you basically just need to feed the selection into the models.

We don’t provide support for custom coding, but can help point you in the right direction.

The documentation for the model system can be found here:–Model-System

You need to set up the where conditions and pass them to the models, take a look at the examples here:–Model-System/


August 13, 2019 at 3:49 am

if (!empty($search)) {
$where[‘EVT_name’] = array(‘LIKE’, $search);

“DWN2020 Conference” : not working when search with half word.


August 13, 2019 at 3:57 am

Solved :
$where[‘EVT_name’] = array(‘LIKE’, ‘%’.$search.’%’);


  • Support Staff

August 13, 2019 at 4:14 am

Just noting that the above is correct.

If you want results based on partial-string matches you need to pass the wildcard characters in the locations you want to use them (usually the beginning and end of the search string) as you have done above.


August 20, 2019 at 4:25 am

Can you help me for state-based event list filter?

$where['Venue_Meta.STA_ID'] = 81;

I have tried above this code but not working. I have check document also but there has not this logic.–Model-System/


August 20, 2019 at 5:07 am

not wroking on event listing page. Can you help me get vanue id using event id on listing?


  • Support Staff

August 20, 2019 at 7:26 am

That should actually be something like:


not wroking on event listing page.

Are you sure you have $event_id set?


August 20, 2019 at 8:42 am

Are you sure you have $event_id set?

Yes, I have set but this function not working on an event for a loop.

I have customized but can you help me with this function.

my custom code after this not working form ref of admin side code. I suggest you please create well document with all king of conditions argument with filter opitons,

foreach ($events as $event):
            $evt_venues = $event->venues();
            $evt_venue = $evt_venues && is_array($evt_venues) ? reset($evt_venues) : null;
            $VNU_ID = $evt_venue instanceof EE_Venue ? $evt_venue->ID() : null;
                $venue = EEH_Venue_View::get_venue($VNU_ID);
                if(isset($venue) && !empty($venue)):
                    $state = $venue->state_obj();
                        $state_list[$state->get('STA_ID')] = $state->get('STA_name');


  • Support Staff

August 20, 2019 at 8:52 am

It sounds like the trouble you’re having is because you’re trying to use functions that are only available on the frontend. Those will not work on the admin side.

You can use the model classes helper method directly, like this one, instead of “View”-based helper methods intended for the front end only. e.g.
$venue = EEM_Venue::instance()->get_one_by_ID($VNU_ID);


August 21, 2019 at 1:52 am

you have not got my point I have need value id using event id.


  • Support Staff

August 21, 2019 at 5:14 am

In the code above, your using an instance of EE_Venue to pull the ID from that EE_Venue, to then pull an instance of EE_Venue?

To explain:

$evt_venues = $event->venues();

venues() pulls an array of all venues linked to the event (an associative array with the key being the venue ID and the value being the EE_Venue object), right now the UI only allows for a single venue to be selected but it’s possible to add more, hence the array.

$evt_venue = $evt_venues && is_array($evt_venues) ? reset($evt_venues) : null;

This sets $evt_venue to be either an instanceof EE_Venue from the $evt_venues array or null.

$VNU_ID = $evt_venue instanceof EE_Venue ? $evt_venue->ID() : null;

Uses $evt_venue to pull the ID of the venue if its an instance of EE_Venue or sets it to null.

if(!empty($VNU_ID)): $venue = EEH_Venue_View::get_venue($VNU_ID);

Uses $VNU_ID you just pulled from an EE_Venue object, to pull an instance of EE_Venue that matches that VNU_ID…

This means $evt_venue and $venue will be identical and most of that code isn’t needed.

espresso_venue_id() is expected to be ran on the front end rather than the admin as it’s a template tag.

you have not got my point I have need value id using event id.

The point Josh is making is your going about this the wrong way, espresso_venue_id() isn’t expected to be used as you are trying to use it.

Why do you need only the Venue ID? I’m assuming its to pull the Venue object as there’s nothing else of value with just the VNU_ID

Is the only value you have at that point the Event ID? No EE_Event object?

You can use the EEM_Venue model to pull a specific venue object linked to an Event ID and from that you could get the ID, but I’m assuming you actually just want the Venue object, not the ID?

The support post ‘How to customize Archive page with filter based’ 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.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 3 months, 3 weeks ago ago

Topic Tags


This topic is: not resolved
Do NOT follow this link or you will be banned from the site!