{"id":1254429,"date":"2017-03-15T06:43:01","date_gmt":"2017-03-15T13:43:01","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/"},"modified":"2017-03-22T00:38:02","modified_gmt":"2017-03-22T07:38:02","slug":"event-categories-show-up-twice-when-translated-for-monthsingle-event-php","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/","title":{"rendered":"Event Categories show up twice when translated (for month\/single-event.php)"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I discovered the following issue: When setting up Events Calendar with WPML (as described in your docs: https:\/\/theeventscalendar.com\/knowledgebase\/setting-up-the-events-calendar-with-wpml\/) and when then capturing new events which have an event category, which is also translated, then they show up twice on templates using the month\/single.php template.<\/p>\n<p>Steps in detail:<\/p>\n<ol>\n<li>Set up a fresh WP install<\/li>\n<li>Install Events Calendar, and WPML.<\/li>\n<li>Set up 2 languages in WPML and configure WPML as described in the docs<\/li>\n<li>Create a new Event Category in language 1.<\/li>\n<li>Go to language 2 and create a translation for the Event Category (create a new Event Category in language 2 and select that it is a translation of the previously created category in language 1)<\/li>\n<li>Now create the venue, organizer and event in the two languages. Set the category respectively<\/li>\n<li>Copy the &#8220;\/wp-content\/plugins\/the-events-calendar\/src\/views\/month\/single-event.php&#8221; to &#8220;\/wp-content\/themes\/yourtheme\/tribe-events\/month\/single-event.php&#8221;<\/li>\n<li>Add the following code to single-event.php (the use case is to show categories in month view (e.g. tooltip etc) &#8211; see attached file:\n<pre><code>echo tribe_get_event_categories( $event_id, array(\r\n\t\t'before'       =&gt; '',\r\n\t\t'sep'          =&gt; ' ',\r\n\t\t'after'        =&gt; '',\r\n\t\t'label'        =&gt; 'Categories', \/\/ An appropriate plural\/singular label will be provided\r\n\t\t'label_before' =&gt; '',\r\n\t\t'label_after'  =&gt; '',\r\n\t\t'wrap_before'  =&gt; '&lt;dd class=\"my-widget-event-categories\"&gt;',\r\n\t\t'wrap_after'   =&gt; '&lt;\/dd&gt;',\r\n\t) );<\/code><\/pre>\n<\/li>\n<li>go to the month view, and you will see it twice<\/li>\n<\/ol>\n<p>This does not happen on the single view of the event (i.e. if you click the event, then you see the category only once). Both templates use <strong>tribe_get_event_categories<\/strong> which uses at the end <strong>get_the_term_list<\/strong>.<\/p>\n<p>How can this be fixed?<\/p>\n","protected":false},"template":"","class_list":["post-1254429","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Event Categories show up twice when translated (for month\/single-event.php) -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Event Categories show up twice when translated (for month\/single-event.php) -\" \/>\n<meta property=\"og:description\" content=\"Hi, I discovered the following issue: When setting up Events Calendar with WPML (as described in your docs: https:\/\/theeventscalendar.com\/knowledgebase\/setting-up-the-events-calendar-with-wpml\/) and when then capturing new events which have an event category, which is also translated, then they show up twice on templates using the month\/single.php template. Steps in detail: Set up a fresh WP install Install [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/\" \/>\n<meta property=\"article:modified_time\" content=\"2017-03-22T07:38:02+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/\",\"name\":\"Event Categories show up twice when translated (for month\/single-event.php) -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-03-15T13:43:01+00:00\",\"dateModified\":\"2017-03-22T07:38:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Event Categories show up twice when translated (for month\/single-event.php)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Event Categories show up twice when translated (for month\/single-event.php) -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/","og_locale":"en_US","og_type":"article","og_title":"Event Categories show up twice when translated (for month\/single-event.php) -","og_description":"Hi, I discovered the following issue: When setting up Events Calendar with WPML (as described in your docs: https:\/\/theeventscalendar.com\/knowledgebase\/setting-up-the-events-calendar-with-wpml\/) and when then capturing new events which have an event category, which is also translated, then they show up twice on templates using the month\/single.php template. Steps in detail: Set up a fresh WP install Install [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/","article_modified_time":"2017-03-22T07:38:02+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/","name":"Event Categories show up twice when translated (for month\/single-event.php) -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-03-15T13:43:01+00:00","dateModified":"2017-03-22T07:38:02+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-categories-show-up-twice-when-translated-for-monthsingle-event-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Event Categories show up twice when translated (for month\/single-event.php)"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1254429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1254429\/revisions"}],"predecessor-version":[{"id":1257871,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1254429\/revisions\/1257871"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1254429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}