{"id":1022472,"date":"2015-11-06T02:42:01","date_gmt":"2015-11-06T10:42:01","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/"},"modified":"2016-02-18T08:30:53","modified_gmt":"2016-02-18T16:30:53","slug":"add-categories-as-css-classes","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/","title":{"rendered":"Add categories as css classes"},"content":{"rendered":"<p>Hello,<\/p>\n<p>In the<strong> single-event.php<\/strong> I need to add the category class to the div containing the schedule details and the cost.<\/p>\n<p>I&#8217;ve tried <strong>tribe_get_event_taxonomy()<\/strong> and <strong>tribe_meta_event_cats()<\/strong>, but it adds some weird HTML tags. Also the following function: <strong>get_the_terms()<\/strong>, but there is a warning instead of the css classes.<\/p>\n<p><strong>Here is an example of the code with &#8220;get_the_therms()&#8221;<\/strong><\/p>\n<p>\t&lt;div class=&#8221;tribe-events-schedule updated published tribe-clearfix &lt;?php get_the_terms() ?&gt;&#8221; &gt;<\/p>\n<p><strong>Here is the warning:<\/strong><br \/>\ntribe-events-schedule updated published tribe-clearfix <strong>&lt;br \/&gt; &lt;b&gt;Warning&lt;\/b&gt;:  Missing argument 1 for get_the_terms(), called in \/Applications\/XAMPP\/xamppfiles\/htdocs\/w\/wp-content\/plugins\/the-events-calendar\/src\/views\/single-event.php on line 35 and defined in &lt;b&gt;\/Applications\/XAMPP\/xamppfiles\/htdocs\/w\/wp-includes\/category-template.php&lt;\/b&gt; on line &lt;b&gt;1352&lt;\/b&gt;&lt;br \/&gt; &lt;br \/&gt; &lt;b&gt;Warning&lt;\/b&gt;:  Missing argument 2 for get_the_terms(), called in \/Applications\/XAMPP\/xamppfiles\/htdocs\/w\/wp-content\/plugins\/the-events-calendar\/src\/views\/single-event.php on line 35 and defined in &lt;b&gt;\/Applications\/XAMPP\/xamppfiles\/htdocs\/w\/wp-includes\/category-template.php&lt;\/b&gt; on line &lt;b&gt;1352&lt;\/b&gt;&lt;br \/&gt; <\/strong><\/p>\n<p>Any help would be much appreciated.<\/p>\n","protected":false},"template":"","class_list":["post-1022472","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>Add categories as css classes -<\/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\/add-categories-as-css-classes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add categories as css classes -\" \/>\n<meta property=\"og:description\" content=\"Hello, In the single-event.php I need to add the category class to the div containing the schedule details and the cost. I&#8217;ve tried tribe_get_event_taxonomy() and tribe_meta_event_cats(), but it adds some weird HTML tags. Also the following function: get_the_terms(), but there is a warning instead of the css classes. Here is an example of the code [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-02-18T16:30:53+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\/add-categories-as-css-classes\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/\",\"name\":\"Add categories as css classes -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-11-06T10:42:01+00:00\",\"dateModified\":\"2016-02-18T16:30:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/#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\":\"Welcome!\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Pre-Sales Questions\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/pre-sales-questions\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Add categories as css classes\"}]},{\"@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":"Add categories as css classes -","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\/add-categories-as-css-classes\/","og_locale":"en_US","og_type":"article","og_title":"Add categories as css classes -","og_description":"Hello, In the single-event.php I need to add the category class to the div containing the schedule details and the cost. I&#8217;ve tried tribe_get_event_taxonomy() and tribe_meta_event_cats(), but it adds some weird HTML tags. Also the following function: get_the_terms(), but there is a warning instead of the css classes. Here is an example of the code [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/","article_modified_time":"2016-02-18T16:30:53+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\/add-categories-as-css-classes\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/","name":"Add categories as css classes -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-11-06T10:42:01+00:00","dateModified":"2016-02-18T16:30:53+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-categories-as-css-classes\/#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":"Welcome!","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/"},{"@type":"ListItem","position":4,"name":"Pre-Sales Questions","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/pre-sales-questions\/"},{"@type":"ListItem","position":5,"name":"Add categories as css classes"}]},{"@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\/1022472","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":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1022472\/revisions"}],"predecessor-version":[{"id":1022578,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1022472\/revisions\/1022578"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1022472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}