{"id":1120298,"date":"2016-05-30T02:25:04","date_gmt":"2016-05-30T09:25:04","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/"},"modified":"2016-05-31T07:00:38","modified_gmt":"2016-05-31T14:00:38","slug":"exclude-particular-tag-from-widget-list","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/","title":{"rendered":"Exclude particular tag from widget list"},"content":{"rendered":"<p>Hello,<br \/>\nI&#8217;m trying to exclude a particular tag term from an instance of a widget list&#8230; I saw that the settings of the widget allows me to add filter, but not to exclude. I&#8217;ve tried your shortcodes too (by adding a &#8220;-&#8221; in front of a slug or of a term id) but it is not working either (this would be handy by the way !). So I&#8217;ve been trying to use a preget post  but with no success so far as I&#8217;m not sure how to target the widget instance: I&#8217;m trying a wordpress function, <code>is_active_widget()<\/code> and I&#8217;m not sure either how to use preget post for the query of that particular instance. So far I get to the following code any hint would be welcome !<br \/>\nThank you.<br \/>\n<code><br \/>\nfunction exclude_tag( $query ){<br \/>\n  if ( is_active_widget( 'tribe-events-adv-list-widget-2') ) {<br \/>\n    $taxquery = array(<br \/>\n        array(<br \/>\n            'taxonomy' =&gt; 'post_tag',<br \/>\n            'field' =&gt; 'id',<br \/>\n            'terms' =&gt; array( 36 ), \/\/the ID of the event tag<br \/>\n            'operator'=&gt; 'NOT IN'<br \/>\n        )<br \/>\n    );<\/p>\n<p>    $query-&gt;set('tax_query', $taxquery);<\/p>\n<p>    return;<\/p>\n<p>  }<\/p>\n<p>}<br \/>\n<\/code><\/p>\n","protected":false},"template":"","class_list":["post-1120298","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>Exclude particular tag from widget list -<\/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\/exclude-particular-tag-from-widget-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exclude particular tag from widget list -\" \/>\n<meta property=\"og:description\" content=\"Hello, I&#8217;m trying to exclude a particular tag term from an instance of a widget list&#8230; I saw that the settings of the widget allows me to add filter, but not to exclude. I&#8217;ve tried your shortcodes too (by adding a &#8220;-&#8221; in front of a slug or of a term id) but it is [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-05-31T14:00:38+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\/exclude-particular-tag-from-widget-list\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/\",\"name\":\"Exclude particular tag from widget list -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-05-30T09:25:04+00:00\",\"dateModified\":\"2016-05-31T14:00:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/#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\":\"Exclude particular tag from widget list\"}]},{\"@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":"Exclude particular tag from widget list -","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\/exclude-particular-tag-from-widget-list\/","og_locale":"en_US","og_type":"article","og_title":"Exclude particular tag from widget list -","og_description":"Hello, I&#8217;m trying to exclude a particular tag term from an instance of a widget list&#8230; I saw that the settings of the widget allows me to add filter, but not to exclude. I&#8217;ve tried your shortcodes too (by adding a &#8220;-&#8221; in front of a slug or of a term id) but it is [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/","article_modified_time":"2016-05-31T14:00:38+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\/exclude-particular-tag-from-widget-list\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/","name":"Exclude particular tag from widget list -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-05-30T09:25:04+00:00","dateModified":"2016-05-31T14:00:38+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/exclude-particular-tag-from-widget-list\/#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":"Exclude particular tag from widget list"}]},{"@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\/1120298","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\/1120298\/revisions"}],"predecessor-version":[{"id":1120386,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1120298\/revisions\/1120386"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1120298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}