Title: Exceptions not displaying in Shortcode
Last modified: August 22, 2016

---

# Exceptions not displaying in Shortcode

 *  [jhartmann](https://wordpress.org/support/users/jhartmann/)
 * (@jhartmann)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/exceptions-not-displaying-in-shortcode/)
 * Hello! My business is closed today for Columbus day, but it is not displaying
   that we are closed, only in the expanded table. How do I fix this? Thanks!
 * [https://wordpress.org/plugins/business-hours-plugin/](https://wordpress.org/plugins/business-hours-plugin/)

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

 *  [brightenyourview](https://wordpress.org/support/users/brightenyourview/)
 * (@brightenyourview)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/exceptions-not-displaying-in-shortcode/#post-5384433)
 * I was able to fix this in BusinessHours.class.php
 * Line 50 – public function shortcode( $atts, $content = null ) {
 * Update this code to for the whole function and it should work for the shortcode
 * public function shortcode( $atts, $content = null ) {
 *  $closed_text = business_hours()->settings()->get_default_closed_text();
 *  extract( shortcode_atts( array( ‘closed’ => $closed_text ), $atts ) );
 *  if ( empty( $content ) )
    return $content;
 *  $day = $this->get_day_using_timezone();
    $id = key( $day );
 *  $open = esc_html( business_hours()->settings()->get_open_hour( $id ) );
    $close
   = esc_html( business_hours()->settings()->get_close_hour( $id ) ); $is_open_today
   = business_hours()->settings()->is_open( $id ); $exceptions = BusinessHoursExceptions::
   instance()->get_exceptions_for_day_id( $id ); if ( !empty( $exceptions ) ) { 
   $open = $exceptions[‘open’]; $close = $exceptions[‘close’]; $is_open_today = !
   empty( $open ) && !empty( $close ); $name = BusinessHoursExceptions::instance()-
   >get_localized_date_for_day_id( $id ); } if ( $is_open_today ) { $content = str_replace(“{{
   TodayOpen}}”, $open, $content ); $content = str_replace( “{{TodayClose}}”, $close,
   $content ); } else { $content = $closed; }
 *  return $content;
    }
 *  [AdamBCarrier](https://wordpress.org/support/users/adambcarrier/)
 * (@adambcarrier)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/exceptions-not-displaying-in-shortcode/#post-5384497)
 * This fixed it. Thanks! I added your solution to the GitHub discussion: [https://github.com/MZAWeb/business-hours-plugin/issues/31#issuecomment-138663938](https://github.com/MZAWeb/business-hours-plugin/issues/31#issuecomment-138663938)
 *  [hillaryharris1635](https://wordpress.org/support/users/hillaryharris1635/)
 * (@hillaryharris1635)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/exceptions-not-displaying-in-shortcode/#post-5384499)
 * Thank you! I had the same problem… this worked perfectly!

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

The topic ‘Exceptions not displaying in Shortcode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/business-hours-plugin_5f605f.svg)
 * [Business Hours Plugin](https://wordpress.org/plugins/business-hours-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/business-hours-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/business-hours-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/business-hours-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/business-hours-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/business-hours-plugin/reviews/)

## Tags

 * [exception](https://wordpress.org/support/topic-tag/exception/)
 * [Short Code](https://wordpress.org/support/topic-tag/short-code/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 3 replies
 * 4 participants
 * Last reply from: [hillaryharris1635](https://wordpress.org/support/users/hillaryharris1635/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/exceptions-not-displaying-in-shortcode/#post-5384499)
 * Status: not resolved