Support

Home Forums Event Espresso Premium EVENT_LIST and EVENT_ESPRESSO_CATEGORY attributes not filtering as expected

EVENT_LIST and EVENT_ESPRESSO_CATEGORY attributes not filtering as expected

Posted: November 18, 2013 at 12:19 am


Jessica Grant

November 18, 2013 at 12:19 am

Hi! I’m having a problem, and none of the forum posts I’ve found in searching have been able to help.

I have created some pages to act as “category” pages, and each is using the EVENT_LIST or EVENT_ESPRESSO_CATEGORY shortcode to display events from that particular category. The pages are behaving exactly as I’d like them to, including showing all of the event details I’d like to show for each event and linking to my custom-post-type-driven posts for more details on each event.

But the pages are listing all events, not restricting the listing to a particular category. They are also showing waiting list events, even though I’ve used the “show-secondary=false” attribute in the shortcodes. Here is a list of the pages and their related shortcodes:

URL: http://www.culture-brain.com/academy/all-classes/
Shortcode: [EVENT_LIST show_secondary=false]

URL: http://www.culture-brain.com/academy/creative-classes/
Shortcode: [EVENT_ESPRESSO_CATEGORY event_category_id=”creative” show_secondary=false]

URL: http://www.culture-brain.com/academy/salons/
Shortcode: [EVENT_ESPRESSO_CATEGORY event_category_id=”salons” show_secondary=false]

URL: http://www.culture-brain.com/academy/performances/
Shortcode: [EVENT_ESPRESSO_CATEGORY event_category_id=”performances” show_secondary=false]

URL: http://www.culture-brain.com/academy/trend-u/
Shortcode: [EVENT_ESPRESSO_CATEGORY event_category_id=”trend-u” show_secondary=false]

• I’ve tried disabling plugins, activating the Twenty-Thirteen theme, and using the unmodified version of post-type-samples/page-event_list.php and the problem persists.
• My registration page is here: http://www.culture-brain.com/academy/event-registration/
• My Event Espresso category ids are as follows: “creative”, “salons”, “performances”, “trend-u”
• I’ve also tried using the EVENT_LIST shortcode on the category pages, formatted as:

[EVENT_LIST category_identifier=salons show_secondary=false]

… but that also doesn’t filter by category or filter out waiting list events.
• All of the above pages are using the page template “Espresso Events” which is from post-type-samples/page-event_list.php. I’m not sure if this is the proper use of that template, or if the shortcodes are designed to even work with that template.

Any ideas on how I might get the category filtering working? Or should I be taking a different approach / using different template files to achieve what I want?

Thank you!


Josh

  • Support Staff

November 18, 2013 at 12:50 pm

Hi Jessica,

When you set the page template setting to use the “Espresso Events” template it will not pull in the shortcode. These pages will need to use a default theme template in order for the shortcodes to process.


Jessica Grant

November 18, 2013 at 9:57 pm

Hi Josh,

Thanks for your help. I’ve taken your advice and used a theme template to display one of the pages. Now my pages filtering correctly. Having one new issue I’d like your advice on:

The markup is now generated in templates/event_list_display.php. The event links are now leading to the Espresso Event pages (for example: http://www.culture-brain.com/academy/event-registration/?ee=3) where I really need links to the associated custom-post-type event (for example: http://www.culture-brain.com/events/popular-event-with-waiting-list/).

I’m not using the Espresso Event (http://www.culture-brain.com/academy/event-registration/?ee=3) pages in my site until I get to the registration process. I’ve spent all my time templating the event pages as custom-post-type posts (http://www.culture-brain.com/events/popular-event-with-waiting-list/).

How could I get the event_list_display.php file to link to the custom-post-type post instead of the Espresso Event post?

Many, many thanks!


Josh

  • Support Staff

November 19, 2013 at 8:42 am

Hi Jessica,

You can make a few edits to the event_list.php file so instead of linking to the native registration page it will link to the corresponding Espresso Event Post type.

If you open up event_list.php and look around line 274 where the

if ( $events ) { 
  foreach ($events as $event) {

loop starts, you can add a post id variable:

$post_id = $event->post_id;

then you can change where it makes the registration url link from:

$registration_url = $externalURL != '' ? $externalURL : espresso_reg_url($event_id);

to:

$registration_url = $externalURL != '' ? $externalURL : get_permalink($post_id);

When you’re done, it would be a good idea to copy over event_list.php and event_list_display.php from the core plugin to /wp-content/uploads/espresso/templates so your changes do not get overwritten on an update.


Jessica Grant

November 20, 2013 at 1:23 pm

Thanks again, Josh, this works perfectly. It also pointed me in the right direction for bringing in the excerpt of the custom post type post. 🙂 I’m marking this issue resolved.

I really appreciate the help of the support staff in getting the functionality working as I’d like it to.

The support post ‘EVENT_LIST and EVENT_ESPRESSO_CATEGORY attributes not filtering as expected’ 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