Posted: August 30, 2016 at 7:49 am
|
Hi, I’m using [ESPRESSO_EVENTS category_slug=”foo”] and it’s working well. However I’d like to modify it’s behaviour a little by getting it to print a message if there are no events in that category. Is this possible? Thanks, Andrew |
Hi Andrew, EE should load a ‘content-none.php’ template file from within your theme if you have one, that should display that no posts are found for the shortcode. Is that not happening currently? |
|
|
Hi Tony, no for some reason the template isn’t loading – though I’d forgotten about it’s existence I had created and added content to it, which is not being shown by the [ESPRESSO_EVENTS] shortcode, any idea? thanks Andrew |
Hmm, ok so where exactly are you placing that template file? (Root of Child/Parent theme etc) What currently shows when there no events, nothing at all? |
|
|
the template is at rootof the parent theme – and nothing shows at all when there are no events – not even in the DOM inspector. I know that’s not much to be going on! |
You have your own custom content within content-none.php right? If you install What The File and reload that page on the front end you’ll see a new menu bar item that shows all of the templates loading – http://take.ms/v0uYP If you view the page using twentyfourteen (you can preview the theme from the admin if preferred) or similar do you see a message stating nothing was found? |
|
|
Man, wish I’d known about What the File before! – doesn’t seem to be picking up my content-none.php Twenty-fourteen is giving me the nothing found message. thanks, Andrew |
|
Hi Tony, I’ve fixed this issue – embarssingly was down to misformatted shortcode – blame this one on user error – sorry to have taken up your time, Andrew |
No time wasted here ๐ I’m just glad your up and running. Can I ask what the problem with the shortcode was? Something to note from your initial post that I hadn’t noticed, |
|
|
It was curly brackets – schoolboy error! |
Ahh, ok. Glad you got it fixed ๐ |
|
The support post ‘Adding Logic to Espresso_Events shortcode’ 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.