Posted: August 12, 2019 at 6:15 pm
|
Hi, several years ago I already asked you about the same subject. Hereby is the topic: https://eventespresso.com/topic/event-list-how-to-have-2-upcoming-and-past-events-blocks/ I built the template and added the filter into the functions.php. However, the page hangs… Are there any changes with regard the actual version of EventEspresso in your 2years old code from here: https://gist.github.com/joshfeck/56bc9e4a3683779fe90f? If there are no changes, it looks like I made some errors in my code. Thx, Vlad. |
Hi there, When you say the page hangs, what happens? A completely white screen? The above snippet is working fine for me so I’m guessing there’s a syntax error in your template/functions.php file. If you enable WP_DEBUG and retest the template does it show any errors? |
|
|
Thank you, i found an error in my code, everything works but it mixes several languages. I use WPML for multilingual support, is there any way to filter the list of posts by current language? Thx, Vlad. |
Officially EE doesn’t support WPML at this time, so not that I’m aware of. |
|
|
And is there any way to make this code working for a shortcode instead of the page template? |
Yes the code can be adapted to do a shortcode. Here’s an example: https://gist.github.com/joshfeck/2f8c67a51ebeec117c7dc3a5cb4e0051 |
|
|
Fantastic, now it is more clear how to build shortcodes. But I am notr sure I understand to which place those files to… If I put the code of file ee_shortcode_past_events.php in the function.php of my child theme, it works. But can it be placed some where else in order to keep the original files? Another problem is multilingual support. I do know that EE4 doesn’t support WPML, but as far as I can see, I can add into the WHERE conditions a code of current language in order to get the list only on the selected language. Am I right? I will add required code here later on… Thx, Vlad. |
If you put the code into a child theme’s functions.php file, you’d need to change the following line: to be:
Then, you place the shortcode-template.php template from the gist into the child theme folder. If you prefer to not add the code to a child theme, you could put all the code into its own plugin by following this guide:
I do not believe so, no. |
|
The support post ‘Past event archive – old topic to be reviewed’ 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.