Title: Shortcode displaying based on dates
Last modified: April 24, 2023

---

# Shortcode displaying based on dates

 *  [kalebweeter14](https://wordpress.org/support/users/kalebweeter14/)
 * (@kalebweeter14)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/shortcode-displaying-based-on-dates/)
 * I’m working in Localhost. No link. (If you still ask me for a link to the site
   I will find you)
 * I am attempting to display “we’re open/ closed” for each of my 4 seasonal hours(
   locations). For the plugin I am using the location can also act as hours depending
   on season.
 * When I attempt to put in the short code that will make this appear depending 
   on date I get an error that shows up on page when I enter more than 1 “we’re 
   open” short codes. Whether I individually lay them out or put them in different
   short codes the problem remains.
 * This seems to be working fine with the display hours
 * Ex:
 *     ```wp-block-code
       [mbhi_seasonal_hours location="Spring Hours" from="April 1" to="June 30"]
   
       [mbhi_seasonal_hours location="Summer Hours" from="July 1" to="August 31"]
   
       [mbhi_seasonal_hours location="Winter Hours" from="January 1" to="February 28"]
   
       [mbhi_seasonal_hours location="Fall Hours" from="September 1" to="December 31"]
       ```
   
 * However, when I repeat this method for “we’re open” short code I get the errors.
 * Ex:
 *     ```wp-block-code
       [mbhi location="Spring Hours" format="12" openmessage="We're open" closedmessage="It's {day}, we're closed now (open again on {next_open_day} at {next_open_time})." from="April1" to="June 30"] 
   
       [mbhi location="Summer Hours" format="12" openmessage="We're open" closedmessage="It's {day}, we're closed now (open again on {next_open_day} at {next_open_time})." from="July 1" to="August 31"]
   
       [mbhi location="Fall Hours" format="12" openmessage="We're open" closedmessage="It's {day}, we're closed now (open again on {next_open_day} at {next_open_time})." from="January 1" to="February 28"]
   
       [mbhi location="Winter Hours" format="12" openmessage="We're open" closedmessage="It's {day}, we're closed now (open again on {next_open_day} at {next_open_time})." from="September 1" to="December 31"]
       ```
   
 * The first “we’re open” works and shows up without problem. When I add the others,
   however, they give me these errors…
 *     ```wp-block-code
       Warning: Attempt to read property "for_ajax" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 26
   
       Warning: Attempt to read property "show_location_error" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 31
       /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 37
       closed">
       Warning: Attempt to read property "indicator_text" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 37
   
       Warning: Attempt to read property "for_ajax" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 26
   
       Warning: Attempt to read property "show_location_error" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 31
       /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 37
       closed">
       Warning: Attempt to read property "indicator_text" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 37
   
       Warning: Attempt to read property "for_ajax" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 26
   
       Warning: Attempt to read property "show_location_error" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 31
       /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 37
       closed">
       Warning: Attempt to read property "indicator_text" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 37
   
       Warning: Attempt to read property "for_ajax" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 26
   
       Warning: Attempt to read property "show_location_error" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 31
       /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 37
       closed">
       Warning: Attempt to read property "indicator_text" on null in /Users/oldhead/Local Sites/four-seasons-nursery/app/public/wp-content/plugins/mabel-business-hours-indicator-pro/templates/indicator.php on line 37
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Alan Fuller](https://wordpress.org/support/users/alanfuller/)
 * (@alanfuller)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/shortcode-displaying-based-on-dates/#post-16683217)
 * > I get an error
 * No you don’t – you get warnings.
   Warnings are for developers / debugging and 
   their display should be suppressed on a live site.Once you turn off warning display–
   does it function as expected ( 99% of warnings and notices have no functional
   impact they generally noting uninitialized data that is ignored )
 *  Thread Starter [kalebweeter14](https://wordpress.org/support/users/kalebweeter14/)
 * (@kalebweeter14)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/shortcode-displaying-based-on-dates/#post-16683733)
 * How do I turn off warning display?
 *  [Alan Fuller](https://wordpress.org/support/users/alanfuller/)
 * (@alanfuller)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/shortcode-displaying-based-on-dates/#post-16683961)
 * first check your wo-config.php and see if debug mode is true?
 * here is an article on my website that should help
 * [https://fullworksplugins.com/docs/plugins-general/troubleshooting-plugins-general/php-notices-and-warnings/](https://fullworksplugins.com/docs/plugins-general/troubleshooting-plugins-general/php-notices-and-warnings/)
 *  Thread Starter [kalebweeter14](https://wordpress.org/support/users/kalebweeter14/)
 * (@kalebweeter14)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/shortcode-displaying-based-on-dates/#post-16683974)
 * I don’t know how to access those files on what I’m using for my localhost site.
   I would usually find them in phpmyadmin or something but I cannot find any sort
   of file manager for what I’m using. I’m using something called “Local”
 *  [Alan Fuller](https://wordpress.org/support/users/alanfuller/)
 * (@alanfuller)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/shortcode-displaying-based-on-dates/#post-16684028)
 * personally i don’t use “local” but the files will be somewhere on your computer.
   However local is very popular so I’m sure there are lots of help and tutorials
   on the internet or on their own support communities.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Shortcode displaying based on dates’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 5 replies
 * 2 participants
 * Last reply from: [Alan Fuller](https://wordpress.org/support/users/alanfuller/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/shortcode-displaying-based-on-dates/#post-16684028)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
