Event Shortcode Not Showing the Right Posts in Categories

Home Forums Calendar Products Events Calendar PRO Event Shortcode Not Showing the Right Posts in Categories

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1092312
    Lang
    Participant

    Hello guys,

    I have site that uses two templates.

    One is for a french page template that his a sidebar widget.

    One is for english page template that has its own sidebar widget.

    I’m using this shortcode:

    [ecs-list-events cat=”fr-Ontario” order=’ASC’ limit=’3′]

    However, it’s not pulling the right data, here is the page in question:

    http://collegecentreofboardexcellence.ca/fr-home/

    If you look to the right side bar, the widget should show only fr-Ontario category events, but it’s showing for some reason :

    1. A broken link: http://collegecentreofboardexcellence.ca/event/introduction-a-la-gestion-des-risques-deuxieme-partie/?lang=fr%2F/

    2. A event that goes to a Non-Ontario event category and not a fr-Ontario category.

    The english version of this page is working fine here:

    http://collegecentreofboardexcellence.ca/home/

    It shows the correct info.

    It uses this shortcode:
    [ecs-list-events cat=”Ontario” order=’ASC’ limit=’3′]

    So can you please help me with the french page and why the shortcode is not working properly .

    #1092718
    Geoff B.
    Member

    Good evening Lang and welcome back!

    Thank you for reaching out to us.

    We are sorry to hear about [ecs-list-events] shortcodes not working properly.

    However, as you might know, these shortcodes actually come from a the following plugin: https://wordpress.org/plugins/the-events-calendar-shortcode/

    As much as we are excited about third-party Dev doing plugins to interact with ours, we simply cannot guarantee their plugins will work in all cases (especially after updates) and more importantly, we cannot offer support for them.

    I would recommend contacting the plugin authors to see what they can do about compatibility of their plugin with WPML.

    With that in mind, if you want to display different widgets or widget contents while using WPML, I would recommend reading the following post on how to do that with the Widget Logic plugin: https://wpml.org/2011/03/howto-display-different-widgets-per-language/

    Let me know how that goes.

    Best regards,
    Geoff B.

    #1093800
    Lang
    Participant

    Thanks for this guys.

    I’m right now using the Event’s Widget List and I added to my sidebar widget for my french page template.

    However, for some reason, it won’t show any events that are categorized as : Fr-Ontario .

    HOwever, if I remove that, it shows the english events no problem.

    Also, another issue is when I use the ICL_LANGUAGE_CODE == ‘fr’, nothing happens, and the english events don’t show up too.

    How do I get it to work ?

    Here is a video of my problem too:

    https://www.youtube.com/watch?v=K0hz7XEn9Z0

    #1093828
    Geoff B.
    Member

    Good evening Lang,

    Since I am a big WPML user myself, I can totally lend in a hand here.

    Here’s what I think is going on. Please let me know if I end creating more confusion 🙂

    You original approach was to use different category names to handle languages. But, with WPML, that will no longer work. The reason for that is that WPML, when set up properly, also translates categories (just like it translates posts).

    In other words, fr-Ontario should now be set up as the WPML translation for the category en-Ontario. Otherwise, by default, both of these will be perceived as “English”.

    Secondly, the widget logic plugin is used to provide the ability to display content on a language specific basis.

    In your case, the widget that has the following shortcode [ecs-list-events cat=”fr-Ontario” order=’ASC’ limit=’3′], should have the ICL_LANGUAGE_CODE == ‘fr’ condition (careful about the unmatching quotation marks here)

    In another widget, you should have the following shortcode [ecs-list-events cat=”en-Ontario” order=’ASC’ limit=’3′] with the ICL_LANGUAGE_CODE == ‘en’ condition

    But, that will only work if:

    1. You have set up the event category translation properly
    2. The Events Calendar Shortcode plugin supports WPML (which I’m not sure about). You might consider using the Events Calendar Pro shortcodes instead: https://theeventscalendar.com/knowledgebase/pro-widget-shortcodes/

    Let me know if that helps.

    Have a great day!

    Geoff B.

    #1094215
    Lang
    Participant

    Thanks Geooff.

    I think I understand.

    The issue I have now is how do I translate, or make the Event Category “Fr-Ontario” be a translation or is tagged by wmpl as french.

    I’ve been looking through support, and can’t seem to find it.

    I’ve found this document:

    Translating Post Categories, Tags, and Custom Taxonomies

    However, it only applies to regular Post Categories and not the Event Categories. There’s no option to make a category a certain language.

    So right now for this page:

    http://collegecentreofboardexcellence.ca/fr-home/

    I’m using this shortcode:

    [tribe_events_list limit=”10″]

    And for widgetlogic : ICL_LANGUAGE_CODE == ‘en’

    It shows all the english events.

    However, when using widgetlogic: ICL_LANGUAGE_CODE == ‘fr’

    It is blank.

    So I’m assuming the problem is fr-Ontario is not french event in the eyes of WPML.

    So how do I make the event Category fr-Ontario as a ‘fr’ to show french events.

    Here’s a video of my current situation:

    https://www.youtube.com/watch?v=SVJPxewl6Sc

    #1094325
    Geoff B.
    Member

    Hey Lang,

    Yes you understand perfectly what the issue is.

    The first thing you need to do is make sure step 6 from the following tutorial is done completely (notice the Events Categories option): https://theeventscalendar.com/knowledgebase/setting-up-the-events-calendar-with-wpml/

    Once that’s done, head over to Events -> Events Categories .

    From there (depending on the language selected), you will be able to tweak and assign event categories to the proper language.

    Let me know if that helps.

    Happy easter!

    Geoff B.

    #1094559
    Lang
    Participant

    Ok,

    Thanks for this Geoff.

    I’ve done step 6 and made sure the event category Fr-Ontario is now french.

    However, it still does not work.

    http://collegecentreofboardexcellence.ca/fr-home/

    Still does not show the french events. The code I’m using is:
    [tribe_events_list limit=”10″]

    and widget logic: ICL_LANGUAGE_CODE == ‘fr’

    But for some reason it won’t show any french events.

    I’ve made a short video .

    https://www.youtube.com/watch?v=wdv9UDI6HQw

    If anyone can help me, it would be much appreciated.

    #1094977
    Geoff B.
    Member

    Hey Lang,

    Congratulations on all the hard work.

    I have good news and bad news. The good news is that you are almost there and I know why you can’t get things to display the way you want them to.

    The bad news is that when you use a multilanguage plugin such as WPML, you need to use it for everything on your site (pages, posts, menus, etc..), not just certain parts (e.g.: events and the calendar).

    What is happening right now is that your home page is still “in english” (the language code associated to it is en-US

    As such, the proper language for the calendar and the widgets can’t kick-in.

    It’s a bit time consuming to set everything up with WPML at first, but once it’s in place everything is super predictable, easy to control and more importantly much better for your SEO.

    Hang in there!

    Geoff B.

    #1097726
    Lang
    Participant

    Thanks

    #1097823
    Geoff B.
    Member

    Hey Lang,

    I’m happy we finally solved everything.

    You are welcome back on our support forums any time 🙂

    For now, I am going to close this thread.

    Have a great week!

    Geoff B.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Event Shortcode Not Showing the Right Posts in Categories’ is closed to new replies.