{"id":1379196,"date":"2017-11-09T09:46:36","date_gmt":"2017-11-09T17:46:36","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/"},"modified":"2017-11-09T09:46:36","modified_gmt":"2017-11-09T17:46:36","slug":"category-conditional-stament","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/","title":{"rendered":"Category Conditional Stament"},"content":{"rendered":"<p>Ok so here is the issue &#8211;<\/p>\n<p>I&#8217;m pulling in all event categories in an event loop displaying the next 6<br \/>\n<code><br \/>\n&lt;?php<br \/>\n$events = tribe_get_events( array(<br \/>\n    'posts_per_page' =&gt; 6,<br \/>\n    'start_date' =&gt; date( 'F j, Y' ),<br \/>\n)); ?&gt;<br \/>\n<\/code><\/p>\n<p>And then in front of the three categories I have I need to display a certain corresponding icon such as this &#8211;<\/p>\n<p><code><br \/>\n&lt;?php if(is_tax(22)) { ?&gt;<\/p>\n<h1>educational<\/h1>\n<p>    &lt;?php } elseif (is_tax(23)) { ?&gt;<\/p>\n<h1>program<\/h1>\n<p>    &lt;?php } elseif (is_tax(24)) { ?&gt;<\/p>\n<h1>resource<\/h1>\n<p>    &lt;?php } else { ?&gt;<br \/>\n    FART<br \/>\n&lt;?php } ?&gt;<br \/>\n<\/code><\/p>\n<p>I have tried &#8211; is_tax() from this support forum &#8211; <\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"Vuf6HoVVOg\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-statement-help-needed\/\">Category conditional statement help needed<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Category conditional statement help needed&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-statement-help-needed\/embed\/#?secret=6oRwHUiwkr#?secret=Vuf6HoVVOg\" data-secret=\"Vuf6HoVVOg\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>I have tried &#8211; $cat_name = single_cat_title( &#8221;, false );  from this support forum &#8211; <\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"MpjBrB2gMo\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/conditional-based-on-event-category\/\">Conditional based on Event Category<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Conditional based on Event Category&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/conditional-based-on-event-category\/embed\/#?secret=Sprl1DVufk#?secret=MpjBrB2gMo\" data-secret=\"MpjBrB2gMo\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>I have tried &#8211; has_term()  from this support forum &#8211; <\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"TD8luL5cX8\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/conditional-categories\/\">Conditional Categories<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Conditional Categories&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/conditional-categories\/embed\/#?secret=Vln4MLeYPN#?secret=TD8luL5cX8\" data-secret=\"TD8luL5cX8\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><br \/>\n&amp; this one &#8211;<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"66IjsbMeSx\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/conditional-tag-for-anything-related-to-plugin-2\/\">Conditional tag for ANYTHING related to plugin?<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Conditional tag for ANYTHING related to plugin?&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/conditional-tag-for-anything-related-to-plugin-2\/embed\/#?secret=PDIzuo3Ffk#?secret=66IjsbMeSx\" data-secret=\"66IjsbMeSx\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>I understand that these Categories come through as Taxonomies (which makes no sense to me as to why this would be implemented this way?).<\/p>\n<p>However nothing seems to work and it just keeps on FARTing.<\/p>\n<p>Any help would be great.<\/p>\n<p>Thanks<\/p>\n","protected":false},"template":"","class_list":["post-1379196","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>Category Conditional Stament -<\/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\/category-conditional-stament\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Category Conditional Stament -\" \/>\n<meta property=\"og:description\" content=\"Ok so here is the issue &#8211; I&#8217;m pulling in all event categories in an event loop displaying the next 6 &lt;?php $events = tribe_get_events( array( &#039;posts_per_page&#039; =&gt; 6, &#039;start_date&#039; =&gt; date( &#039;F j, Y&#039; ), )); ?&gt; And then in front of the three categories I have I need to display a certain corresponding [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/\" \/>\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\/category-conditional-stament\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/\",\"name\":\"Category Conditional Stament -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-11-09T17:46:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/#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\":\"Category Conditional Stament\"}]},{\"@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":"Category Conditional Stament -","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\/category-conditional-stament\/","og_locale":"en_US","og_type":"article","og_title":"Category Conditional Stament -","og_description":"Ok so here is the issue &#8211; I&#8217;m pulling in all event categories in an event loop displaying the next 6 &lt;?php $events = tribe_get_events( array( 'posts_per_page' =&gt; 6, 'start_date' =&gt; date( 'F j, Y' ), )); ?&gt; And then in front of the three categories I have I need to display a certain corresponding [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/","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\/category-conditional-stament\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/","name":"Category Conditional Stament -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-11-09T17:46:36+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/category-conditional-stament\/#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":"Category Conditional Stament"}]},{"@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\/1379196","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":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1379196\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1379196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}