{"id":1951495,"date":"2021-12-21T08:17:26","date_gmt":"2021-12-21T13:17:26","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?post_type=tribe-knowledgebase&#038;p=1951495"},"modified":"2022-11-17T09:25:50","modified_gmt":"2022-11-17T14:25:50","slug":"how-to-mark-a-business-as-closed","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/how-to-mark-a-business-as-closed\/","title":{"rendered":"How To Mark a Business as &#8220;Closed&#8221; with The Events Calendar"},"content":{"rendered":"\n<p>In this article, we&#8217;ll show you how to mark your business as &#8220;Closed&#8221; in Month View with your events from <a href=\"https:\/\/theeventscalendar.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">The Events Calendar<\/a>. We&#8217;ve provided you with two methods to do this: CSS and PHP.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-add-a-css-snippet\">How to add a CSS snippet<\/h2>\n\n\n\n<p>There are a few methods that you can use to add CSS to your WordPress site. You can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add custom styles directly to your stylesheets<\/li>\n\n\n\n<li>Use the WordPress Customizer<\/li>\n\n\n\n<li>Overwrite CSS files<\/li>\n<\/ul>\n\n\n\n<p>For more information on how to add CSS to your site, <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/k\/customizing-css\/\" target=\"_blank\" rel=\"noreferrer noopener\">this Knowledgebase article<\/a> can walk you through the process so that you can determine the right method for you.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-css-snippet\">The CSS snippet<\/h2>\n\n\n\n<p>Add the following CSS snippet to your stylesheet in order to display the word &#8220;Closed&#8221; on your Month View calendar.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\n.tribe-events-calendar-month__week .tribe-events-calendar-month__day:nth-child(6) .tribe-events-calendar-month__events:after,\n.tribe-events-calendar-month__week .tribe-events-calendar-month__day:nth-child(7) .tribe-events-calendar-month__events:after {\n\tcontent:&quot;CLOSED&quot;;\n\tfont-size:14px;\n\tmargin:10px;\n\tbackground-color:red;\n\tpadding:5px;\n\tborder-radius:10px;\n}\n<\/pre><\/div>\n\n\n<p>It&#8217;ll look something like this on the frontend:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/12\/Screen-Shot-2021-12-21-at-11.05.24-AM.png\" alt=\"mark your business as closed with The Events Calendar\" class=\"wp-image-1951496\"\/><\/figure>\n\n\n\n<p>To show a &#8220;Closed&#8221; text inside a specific Month View date, you can modify the following CSS snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\n.tribe-events-calendar-month__day&#x5B;aria-labelledby=&quot;tribe-events-calendar-day-2022-12-25&quot;] .tribe-events-calendar-month__events:after {\n    background: red;\n    color: white;\n    content: &quot;CLOSED&quot;!important;\n    font-size: 14px;\n    padding: 10px;\n    margin-left: 20%;\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-customizing-the-css-snippet\">Customizing the CSS snippet<\/h2>\n\n\n\n<p>You can customize the above snippet by changing the word &#8220;Closed&#8221; to something else, changing the font-size element, background color, or the padding and border.<\/p>\n\n\n\n<p>If you&#8217;d like to change which days are marked as &#8220;Closed&#8221;, you&#8217;ll want to edit the number next to <code>nth-child<\/code> or add another <code>nth-child<\/code> to include additional &#8220;Closed&#8221; dates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to add a PHP snippet<\/h2>\n\n\n\n<p>If you choose the PHP method, you&#8217;ll want to create a template override of this file: <code>\/the-events-calendar\/v2\/month\/calendar-body\/day\/cell.php<\/code><\/p>\n\n\n\n<p>For more information on how to create a template override, check out <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/k\/customizing-template-files-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">this Knowledgebase article<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-php-snippet\">The PHP snippet<\/h2>\n\n\n\n<p>Once you&#8217;ve created a template override, you can add the following snippet to line 54:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;!-- Mark as &quot;Closed&quot; --&gt;\n&lt;?php if ( in_array( Tribe__Date_Utils::build_date_object( $day&#x5B;&#039;date&#039;] )-&gt;format( &#039;w&#039; ), &#x5B; 0, 6 ] ) &amp;&amp; empty($day&#x5B;&#039;events&#039;])  &amp;&amp; empty($day&#x5B;&#039;multiday_events&#039;])) {?&gt;\n\t&lt;div class=&quot;tribe-events-calendar-month__calendar-event&quot;&gt;\n\t\t&lt;div class=&quot;tribe-common-h8 tribe-common-h--alt&quot;&gt;&lt;?php esc_html_e( &#039;Closed&#039;, &#039;the-events-calendar&#039; ); ?&gt;&lt;\/div&gt;\n\t&lt;\/div&gt;\n&lt;?php } ?&gt;\n<\/pre><\/div>\n\n\n<p>Here is what you&#8217;ll see on your calendar:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/12\/Captura-de-Tela-2021-12-22-a\u0300s-11.55.16.png\" alt=\"Mark business as closed with PHP\" class=\"wp-image-1951509\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-customizing-the-php-snippet\">Customizing the PHP snippet<\/h2>\n\n\n\n<p>To customize this snippet, we&#8217;d recommend using CSS to create a custom class on the second div in the PHP snippet.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we&#8217;ll show you how to mark your business as &#8220;Closed&#8221; in Month View with your events from The Events Calendar. We&#8217;ve provided you with two methods to do this: CSS and PHP. How to add a CSS snippet There are a few methods that you can use to add CSS to your&#8230;<\/p>\n","protected":false},"author":3,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[116,24,59,79],"tags":[23,25,58],"stellar-product-taxonomy":[161],"class_list":["post-1951495","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css-styling","category-customizing","category-php-function-snippets","category-snippets","tag-css","tag-customizations","tag-php","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":116,"label":"CSS &amp; Styling"},{"value":24,"label":"Customizations"},{"value":59,"label":"PHP Functions &amp; Snippets"},{"value":79,"label":"Snippets"}],"post_tag":[{"value":23,"label":"CSS"},{"value":25,"label":"Customizations"},{"value":58,"label":"PHP"}],"stellar-product-taxonomy":[{"value":161,"label":"The Events Calendar"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Jaime Marchwinski","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/jaimetri-be\/"},"comment_info":0,"category_info":[{"term_id":116,"name":"CSS &amp; Styling","slug":"css-styling","term_group":0,"term_taxonomy_id":116,"taxonomy":"category","description":"","parent":24,"count":40,"filter":"raw","term_order":"0","cat_ID":116,"category_count":40,"category_description":"","cat_name":"CSS &amp; Styling","category_nicename":"css-styling","category_parent":24},{"term_id":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":157,"filter":"raw","term_order":"0","cat_ID":24,"category_count":157,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":59,"name":"PHP Functions &amp; Snippets","slug":"php-function-snippets","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":127,"filter":"raw","term_order":"0","cat_ID":59,"category_count":127,"category_description":"","cat_name":"PHP Functions &amp; Snippets","category_nicename":"php-function-snippets","category_parent":24},{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":80,"filter":"raw","term_order":"0","cat_ID":79,"category_count":80,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0}],"tag_info":[{"term_id":23,"name":"CSS","slug":"css","term_group":0,"term_taxonomy_id":23,"taxonomy":"post_tag","description":"","parent":20,"count":33,"filter":"raw","term_order":"0"},{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":102,"filter":"raw","term_order":"0"},{"term_id":58,"name":"PHP","slug":"php","term_group":0,"term_taxonomy_id":58,"taxonomy":"post_tag","description":"","parent":20,"count":78,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1951495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1951495"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1951495\/revisions"}],"predecessor-version":[{"id":1955895,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1951495\/revisions\/1955895"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1951495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1951495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1951495"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1951495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}