Support

Home Forums Event Espresso Premium Hiding Full Events from the Events List.

Hiding Full Events from the Events List.

Posted: March 2, 2014 at 4:04 pm

Viewing 5 reply threads


Ben

March 2, 2014 at 4:04 pm

I saw a post about hiding Sold Out events using an earlier version of Event Espresso but I do not know where to use the code snippet in the newer version I am using. I would like to hide events that are full from the event list based on a particular category.

I am using WP 3.8.1
Event Espresso 3.1.36.4
Add-ons: Recurring Events, Groupon, and Calendar
This is an installation that was recently upgraded.
The registration page I am working on is http://corkandclick.com/comprehensive-class/


Dean

March 3, 2014 at 3:08 am

Hi,

In EE 3.1.36.4, in the event_list.php at line 428

							default:

if (get_number_of_attendees_reg_limit($event_id, 'num_completed') < $reg_limit) {

								//Uncomment to show active status array
								//print_r( event_espresso_get_is_active($event_id));
								if ( empty( $path ) ) {
									include( $template_name );
								} else {
									include( $path );
								}
}

Please note that it is a good idea to copy the event_list.php and event_list_display.php over to wp-content/uploads/espresso/templates/ and to edit the files there. Otherwise updates will over write your changes.


Ben

March 4, 2014 at 5:28 pm

I updated the event_list.php file with the above example, but there is no change in the behavior. Events that are full are still displaying in the events list. Do I need to update something in the event_list_display.php file? I started using the template calendar table plugin. That is the plugin where I would like the full events to NOT be displayed.


Sidney Harrell

March 4, 2014 at 9:06 pm

When trying to diagnose whether some code is really running, one quick and dirty way to do it is to stick a line in:

die('made it here');

Then load the page in question. If the page crashes and outputs the line “made it here”, then you know that that line of code has been reached. I would try that with your event_list.php file to make sure that the file that you think is being used is actually being used.


Ben

March 6, 2014 at 9:31 am

I added the line of code suggested and it actually caused the siote to not render at all. The “made it here” line did not display. Below is the updates that I made. I copied both the even_list.php and the event_lis_display.php to the uploads\espresso\templates directory.
<pre class=”brush: php; gutter: true; first-line: 1; highlight: []; html-script: false”>
default:
if (get_number_of_attendees_reg_limit($event_id, 'num_completed') < $reg_limit) {

//Uncomment to show active status array
//print_r( event_espresso_get_is_active($event_id));
if ( empty( $path ) ) {
include( $template_name );
} else {
include( $path );
}
die('made it here');
}


Sidney Harrell

March 6, 2014 at 12:41 pm

You may have a mismatch in the number of opening and closing braces. In wp-config.php try changing WP_DEBUG to true.

Viewing 5 reply threads

The support post ‘Hiding Full Events from the Events List.’ 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