Support

Home Forums Event Espresso Premium No events available

No events available

Posted: June 18, 2014 at 8:47 am

Viewing 3 reply threads


blue level

June 18, 2014 at 8:47 am

hi
im trying to change what happens when no events are available
i have found this code

<code>echo &quot;&lt;div id=&#039;event_content&#039; class=&#039;event_content&#039;&gt;&quot;;
		if ( count($events) &lt; 1) {
			//echo $sql;
			echo __(&#039;&lt;div class=&quot;noevent&quot;&gt;no events available...&lt;/div&gt;&#039;, &#039;event_espresso&#039;);
		}</code>

and what i would like it to do is grab a template file when no events are available
as there is lots of elements i want to show


Josh

  • Support Staff

June 18, 2014 at 12:43 pm

Hi Blue,

You could swap in a PHP include there, or if you add the template to your theme folder, you can use get_template_part(). So for example, your template that you want to load up there is named content-no_events.php, you place this line of code in place of the echo __('No events available...', 'event_espresso');:

get_template_part('content', 'no_events');


blue level

June 19, 2014 at 1:30 am

worked a treat
thanks alot 🙂


Dean

June 19, 2014 at 4:35 am

Hi,

Can we mark this as resolved?

Viewing 3 reply threads

The support post ‘No events available’ 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