Events Made Easy › Forums › Generic › Event list not shown any more
Tagged: conditional tag
- This topic has 6 replies, 2 voices, and was last updated 5 years, 9 months ago by Anonymous.
-
AuthorPosts
-
Thu 7 Feb 2019 at 12:49 #59595AnonymousInactive
Hi Franky,
I am using your plugin on a Site where workshops on different topics are offered. These topics are assigned to different pages and I show all related upcoming events in the sidebar. Because I don’t want to get a message when no event is offered, I used a custom code instead of your widget:
<?php
if (is_page (2) || is_child(2) || is_ancestor(2)) {
if (eme_are_events_available($scope = “future”, $order = “ASC”, $location_id = “”, $category = 1)) {
echo (‘<h2 class=”widgettitle”>VERANSTALTUNGEN ZUM THEMA GEWALT</h2>’);
eme_get_events_list(“limit=5&category=1&order=ASC&format=<li class=dateandtown>#_STARTDATE <span style=color:#cb5924>/</span> #_TOWN<li class=eventtitle>#_LINKEDNAME“);
}
} ?>
It worked fine for several years, but now I am working on a relaunch, moved the site and updated the database – and only the heading is shown.
Can you give me any hint, what went wrong?Thanks,
MeikeThu 7 Feb 2019 at 16:10 #59599FrankyKeymasterJust use [eme_events], with the “template_id_no_events” option, and with the 3 templates (for header, content, footer, and put in the header also your widgettitle).
Also, the way you cann eme_are_events_available is completely wrong …
Youre using
eme_are_events_available($scope = “future”, $order = “ASC”, $location_id = “”, $category = 1)
while you should be using
eme_are_events_available("future", "ASC", "", 1)
Please debug your eme_get_events_list too… I don’t think your format is correct at all (not encloded in quotes here).
And use the “code” button to enclose your code please.Mon 11 Feb 2019 at 16:09 #59622AnonymousInactiveThanks for your answer. Sounds like buggy shit but as mentioned before it worked for several years. So maybe it wasn’t completly wrong. Actually I didn’t understand your first suggeation and when I tried the code I got an error-message…
Mon 11 Feb 2019 at 17:05 #59623FrankyKeymasterA wrong usage of php function arguments for years is not buggy, it is just wrong 🙂
Maybe it did work of course, I don’t know … I just gave the correct call here (it is what your call should be, but do post the error message).
And this just came to mind: you’re using eme_get_events_list, but the way it returns events changed some months ago. See this post for the fix there:
https://www.e-dynamics.be/wordpress/forums/topic/issue-with-widget-ul-headers/#post-59131 (simply put: put “print” in front of the call).Fri 22 Feb 2019 at 12:34 #59665AnonymousInactiveThanks, your hint solved a problenm on another site, where the events on the front-page also didn’t show up anymore.
But actually all my efforts to reanimate events in the sidebar on the other site were unsuccsessful. Maybe there is a better solution than using this code in the page.php. You were talking about the “template_id_no_events” option and the three templates I could use. To be honest I don’t understand where to start with this. Can I put it in a widget?
Thanks in advance!
Fri 22 Feb 2019 at 13:26 #59667FrankyKeymasterSee https://www.e-dynamics.be/wordpress/category/documentation/6-shortcodes/eme_events/
So: instead of using the EME list widget, use a text widget with the [eme_events] shortcode (make sure shortcodes work in your widgets) and customize the options for template_id_no_events, template_id, template_id_header and template_id_footer (as explained in that page).
In other words: start using [eme_events] until it returns the list the way you want it.Thu 28 Feb 2019 at 17:48 #59697AnonymousInactiveTook some time, but now I got it. Thanks for your patience.
-
AuthorPosts
- The forum ‘Generic’ is closed to new topics and replies.