{"id":987584,"date":"2015-07-18T10:42:28","date_gmt":"2015-07-18T17:42:28","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/"},"modified":"2015-08-03T13:00:36","modified_gmt":"2015-08-03T20:00:36","slug":"list-widget-sold-out-on-sale","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/","title":{"rendered":"list-widget ..sold out \/ on sale"},"content":{"rendered":"<p>https:\/\/theeventscalendar.com\/knowledgebase\/adding-sold-out-notices-in-list-view\/<\/p>\n<p>Hi,, a few days ago I successfully created &#8220;sold out&#8221; and &#8220;On sale&#8221; notices in the list view. <\/p>\n<p>I have now tried to do the same for the widget view and am struggling. <\/p>\n<p>I created a directory wp-content\/themes\/my-child-theme\/widgets\/list-widget.php<\/p>\n<p>and copied the code from the link above into the list-widget.php file now in my child theme. But I do not see any sold out or on sales notices. Here is the code in the file<\/p>\n<p>}<\/p>\n<p>\/\/ Retrieves the posts used in the List Widget loop.<br \/>\n$posts = tribe_get_list_widget_events();<\/p>\n<p>\/\/ The URL for this widget&#8217;s &#8220;View More&#8221; link.<br \/>\n$link_to_all = tribe_events_get_list_widget_view_all_link( $instance );<\/p>\n<p>\/\/ Check if any posts were found.<br \/>\nif ( isset( $posts ) &amp;&amp; $posts ) :<\/p>\n<p>\tforeach ( $posts as $post ) :<br \/>\n\t\tsetup_postdata( $post );<br \/>\n\t\tdo_action( &#8216;tribe_events_widget_list_inside_before_loop&#8217; ); ?&gt;<\/p>\n<p>\t\t&lt;!&#8211; Event  &#8211;&gt;<br \/>\n\t\t&lt;div class=&#8221;&lt;?php tribe_events_event_classes() ?&gt;&#8221;&gt;<br \/>\n\t\t\t&lt;?php tribe_get_template_part( &#8216;pro\/widgets\/modules\/single-event&#8217;, null, $instance ) ?&gt;<br \/>\n\t\t&lt;\/div&gt;&lt;!&#8211; .hentry .vevent &#8211;&gt;<\/p>\n<p>\t\t&lt;?php do_action( &#8216;tribe_events_widget_list_inside_after_loop&#8217; ) ?&gt;<\/p>\n<p>\t&lt;?php endforeach ?&gt;<\/p>\n<p>\t&lt;p class=&#8221;tribe-events-widget-link&#8221;&gt;<br \/>\n\t\t<a>&#8221; rel=&#8221;bookmark&#8221;&gt;<br \/>\n\t\t\t&lt;?php _e( &#8216;View More&hellip;&#8217;, &#8216;tribe-events-calendar-pro&#8217; ) ?&gt;<br \/>\n\t\t<\/a><br \/>\n&lt;?php if ( tribe_events_has_soldout() ): ?&gt;<br \/>\n    &lt;span class=&#8221;tickets-sold-out&#8221;&gt;<br \/>\n        Sold out!<br \/>\n    &lt;\/span&gt;<br \/>\n&lt;?php elseif ( tribe_events_has_tickets() ): ?&gt;<br \/>\n    &lt;span class=&#8221;tickets-in-stock&#8221;&gt;<br \/>\n        On sale!<br \/>\n    &lt;\/span&gt;<br \/>\n&lt;?php endif ?<br \/>\n\t&lt;\/p&gt;<\/p>\n<p>&lt;?php<br \/>\n\/\/ No Events were found.<br \/>\nelse:<br \/>\n?&gt;<br \/>\n\t&lt;p&gt;&lt;?php printf( __( &#8216;There are no upcoming %s at this time.&#8217;, &#8216;tribe-events-calendar&#8217; ), strtolower( tribe_get_event_label_plural() ) ); ?&gt;&lt;\/p&gt;<br \/>\n&lt;?php<br \/>\nendif;<\/p>\n<p>\/\/ Cleanup. Do not remove this.<br \/>\nwp_reset_postdata();<\/p>\n<p>perhaps I am putting the new code in the wrong place??? can you advise&#8230;.<\/p>\n","protected":false},"template":"","class_list":["post-987584","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>list-widget ..sold out \/ on sale -<\/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\/list-widget-sold-out-on-sale\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"list-widget ..sold out \/ on sale -\" \/>\n<meta property=\"og:description\" content=\"https:\/\/theeventscalendar.com\/knowledgebase\/adding-sold-out-notices-in-list-view\/ Hi,, a few days ago I successfully created &#8220;sold out&#8221; and &#8220;On sale&#8221; notices in the list view. I have now tried to do the same for the widget view and am struggling. I created a directory wp-content\/themes\/my-child-theme\/widgets\/list-widget.php and copied the code from the link above into the list-widget.php file now in my child [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-08-03T20:00:36+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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/\",\"name\":\"list-widget ..sold out \/ on sale -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-07-18T17:42:28+00:00\",\"dateModified\":\"2015-08-03T20:00:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/#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\":\"list-widget ..sold out \/ on sale\"}]},{\"@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":"list-widget ..sold out \/ on sale -","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\/list-widget-sold-out-on-sale\/","og_locale":"en_US","og_type":"article","og_title":"list-widget ..sold out \/ on sale -","og_description":"https:\/\/theeventscalendar.com\/knowledgebase\/adding-sold-out-notices-in-list-view\/ Hi,, a few days ago I successfully created &#8220;sold out&#8221; and &#8220;On sale&#8221; notices in the list view. I have now tried to do the same for the widget view and am struggling. I created a directory wp-content\/themes\/my-child-theme\/widgets\/list-widget.php and copied the code from the link above into the list-widget.php file now in my child [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/","article_modified_time":"2015-08-03T20:00:36+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/","name":"list-widget ..sold out \/ on sale -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-07-18T17:42:28+00:00","dateModified":"2015-08-03T20:00:36+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/list-widget-sold-out-on-sale\/#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":"list-widget ..sold out \/ on sale"}]},{"@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\/987584","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":3,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/987584\/revisions"}],"predecessor-version":[{"id":987771,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/987584\/revisions\/987771"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=987584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}