codingforsail
April 27, 2022 at 8:23 am
Hi,
On this page: https://essa.org.uk/groups/holiday-activities/
we are showing a number of different shortcodes so that we can break down the events into school holiday periods using an event category.
So for “October Half-Term” we have
[ESPRESSO_EVENTS category_slug=october show_title=false limit=35 css_class=essa_events_css]
but there are no events yet. Is there a parameter to the shortcode so we could add some text, eg “No events yet”?
Best wishes,
Anita
Sam
April 29, 2022 at 6:06 am
Add New Note to this Reply
Hello Anita,
Thank you for contacting us.
Yes, you can add the text “No events yet” to the page where the events are not available.
Basically the text “No Events/post yet” appears due to the “content-none.php” file in the theme folder.
As the file is not available in the theme file it is not showing the text when the page is blank.
So you need to create a “content-none.php” file and upload that to the root folder of the child theme through FTP or Cpanel.
You can add the below code within the “content-none.php” and upload it for a better result:
<?php if ( 'espresso_events' === get_post_type() ) : ?>
<h1 class="page-title">No events yet</h1>
<?php else : ?>
<h1 class="page-title">No Posts yet</h1>
<?php endif; ?>
You can create a child theme to avoid reset of modifications made in the Theme file.
Hope that helps.
Thank you.
codingforsail
May 3, 2022 at 8:24 am
Add New Note to this Reply
Hi Sam,
Thanks, I think I’ll try it on the non-live copy of their website first.
They do already have a child theme.
Best wishes,
Anita
Tony
May 3, 2022 at 10:37 am
Add New Note to this Reply
Hi Anita,
Just to note there was a typo in the above reply (I’ve now fixed).
The template file loaded is content-none.php