Posted: September 12, 2018 at 8:35 pm
|
Dear Event Espresso expert, I found this sample website using event espresso: https://psg.ca/events/ Best regards
|
Hi there, To be honest, I don’t know if there is a name for that format, it’s a custom format built from piecing the dates together. I don’t think you will find an example template. If you are building your own, may I ask which part you are having problems with? If you have a DateTime object you call each of those details individually and build the combined output from that, I can provide some more details on how you would pull each specific details if that will help? |
|
|
I want to change the events list page. If you could provide some more details on how to pull each specific details, that would be my big help. Thank you in advance! |
|
Do I need to change just php code or just css code or both? Any hint and help would be great. |
Hi, If you’re using a child theme, you’ve got a great head start. Then, 1) Make a copy of the theme’s archive.php or the index.php template and put the copy into the active WordPress child theme
|
|
|
September 14, 2018 at 10:18 am I found achieve-espresso_events.php under Espresso_Arabica_2014, it provide me a link from the achieve.php to espresso event through the following code: <section id=”primary” class=”content-area”> Is this on the right direction? Also I already have astra child them activated, which means I cannot activate another theme, then how to use the Event Espresso Arabica Theme? __________________________________________________________________ |
September 14, 2018 at 10:29 am In this case, you actually do not use the Event Espresso Arabica theme. That’s a child theme for the twentyfourteen theme. So if you happened to be using twentyfourteen, you could use Arabica a child theme. Instead, you follow the directions I wrote earlier. Since you’re using the Astra theme, you’ll copy the archive.php file into your child theme, then rename it to be archive-espresso_events.php. |
|
|
September 14, 2018 at 10:44 am Should I copy the following section to the astra achieve-espresso_events.php? <section id=”primary” class=”content-area”> |
|
September 14, 2018 at 10:47 am The astra achieve.php has the following: 19 <div id=”primary” <?php astra_primary_class(); ?>> |
September 14, 2018 at 11:02 am No. You do not copy the code from the Event Espresso Arabica theme’s archive-espresso_events.php template file. Again, the steps to follow are: |
|
|
September 14, 2018 at 11:09 am The code you provided is for the information of a single event. I still need a list or loop of all events before customize the details of the single event. Should I add the loop of events right into new copied archive-espresso_events.php? Or should I call a function to do the loop? |
September 14, 2018 at 11:20 am You could replace Astra’s loop ( |
|
|
September 15, 2018 at 12:15 pm In order to activate archive-espresso_events.php, should I add a line to the function.php? |
No, you usually don’t need to add anything to functions.php, unless the theme is doing some unexpected.
The function mentioned in that post is used to include a file they have included functions they have used in the archive template, that’s not what you are doing. If you follow the WordPress template hierarchy: https://developer.wordpress.org/themes/basics/template-hierarchy/#visual-overview You’ll see that So as it stands is the template not loading? |
|
|
Thank you for your patient reply. I can load it now by choosing the template at the event page. The archive.php calls the function astra_content_loop(). I found where that function is at and copied the it’s file, astra/template-parts/class-astra-loop.php to the child theme folder and rename it class-astra-event-loop.php. I rename all the function in the new file from astra_ to astra_theme. However, when I call astra_event_content_loop(), it cannot be found. Also astra_event_content_loop() will call get_template_part( ‘template-parts/content’, astra_get_post_format() ); It actually will call astra/template-parts/blog/blog-layout.php. I realize blog-layout.php is what I can modify for each event. I wander, may I make a folder template-parts in the child theme and call the function in it, event= a subfolder “blog” under template-parts. May be that’s what mentioned in the previous link you explained. |
Hi, I’m not quite sure I follow, especially the part about renaming functions. Typically though, yes, whenever a template calls get_template_part() it will first look in the child theme at the specified location, then if not found, it will look in the parent theme. There’s more information in this WordPress Developer documentation article: https://developer.wordpress.org/reference/functions/get_template_part/ |
|
|
Josh, I am using hooks to add a new function loop_markup_event to astra_content_loop by add_action(‘astra_content_loop’, ‘loop_markup_event’); |
Hi, In that case you could use the remove_action() function to remove the loop_markup function. Here’s an example from your question:
One thing to note about the above example is it includes a conditional that checks if the current request is the post type archive for Event Espresso events. If it’s just a regular page using a page template, you’ll need to change the conditional to match that page. |
|
|
Josh, that’s neat. Also I realize there’s a shortcut also works: https://gist.github.com/lorenzocaum/6eb0daad8ce58cfd83f6c6fc327d1e6a And then, makedir template-parts/blog under child theme folder. And just using the default template and customize the event-layout.php. |
The support post ‘Date format (6)’ 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.