Support

Home Forums Event Espresso Premium Add message if no upcoming dates

Add message if no upcoming dates

Posted: June 3, 2019 at 6:53 pm

Viewing 6 reply threads


jonmaxim

June 3, 2019 at 6:53 pm

Hello! Just wondering if it’s possible to have a message appear if there are no upcoming dates? Something like “Contact me to be kept in the loop for upcoming dates” with the Contact me as a link to the contact page.

Example event page here https://maxim.bantergroup.com.au/copywriting-courses/maximum-copy/

Regards
Melanie


Josh

  • Support Staff

June 3, 2019 at 7:38 pm

Hi Melanie,

That may be possible. May are ask is there a shortcode on that page that outputs the dates when there are upcoming dates? If so, what’s the shortcode?


jonmaxim

June 4, 2019 at 4:50 pm

Hi Josh! Thanks for your reply.

The shortcode at the bottom of that page is
[ESPRESSO_EVENTS category_slug=maximum-copy]

Melanie


jonmaxim

June 4, 2019 at 4:53 pm

Sorry, forgot to add that I would need the same feature (if possible) at the bottom of all course pages. I think currently all dates are expired so no pages are displaying anything:
https://maxim.bantergroup.com.au/copywriting-courses/writing-for-digital/
https://maxim.bantergroup.com.au/copywriting-courses/the-copy-ninja/


Tony

  • Support Staff

June 7, 2019 at 8:38 am

If there are no events for the ESPRESSO_EVENTS shortcode to display, it will try to load your themes content-none.php template file from within the root directory of the theme, if you don’t have that template file within root nothing will load.

So, one option is to create a content-none.php template file within your themes root directory and add the content you want to be displayed there (I know from previous threads that you are using a child theme, so your content-none.php file would go there).

However, there is one issue with doing that in that if your theme is calling that same file for other areas and doesn’t have a template for specific post types, the new template you use will be used when those sections return no posts.

Does your theme current have templates to display when no content is found?


jonmaxim

June 11, 2019 at 12:16 am

Hi Tony … I have no idea!! Where would I look to see if my theme has a template to display when no content is found?

Melanie


Tony

  • Support Staff

June 11, 2019 at 4:10 am

You’d look in the parent theme for a content-none.php template file or similar.

The location of which depends on your theme, but any file with ‘none’ in the filename could it. Based on the fact that there’s no content loading currently when there are no posts/events on the above pages, it’s unlikely you’ll have a content-none.php in the root directory right now.

The reason you want a file from your theme (if it has one already) is it will use the classes etc that your theme expects rather than just using any file (you could copy the content-none.php file from the twentyseventeen file and use that, but it may not match the CSS ID’s/Classes expected by your theme).

Viewing 6 reply threads

The support post ‘Add message if no upcoming dates’ 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