Title: problem shortcode
Last modified: August 31, 2016

---

# problem shortcode

 *  [nawak](https://wordpress.org/support/users/nawak/)
 * (@nawak)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/problem-shortcode-1/)
 * hello,
 * thanks for this plugin, however i have a problem
    when i use this shortcode :[
   is_open]This content is only shown when you are open[/is_open] [is_closed]This
   content is only shown when you are closed[/is_closed]
 * it works only if no time is set i wish that 9:00:19:30 at 19:30 the closed message
   appear can you repair this ?
 * and the closed day is not display when i check case in widget 🙁
 * ty 🙂
 * [https://wordpress.org/plugins/wp-opening-times-pro/](https://wordpress.org/plugins/wp-opening-times-pro/)

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

 *  Plugin Author [wearewoolf](https://wordpress.org/support/users/wearewoolf/)
 * (@wearewoolf)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/problem-shortcode-1/#post-7273437)
 * Hi Nawak,
 * Let me have a look into this for you.
 * Could you confirm which version of WordPress you are running?
 * Thanks
 *  Plugin Author [wearewoolf](https://wordpress.org/support/users/wearewoolf/)
 * (@wearewoolf)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/problem-shortcode-1/#post-7273458)
 * Hi Nawak,
 * We have been testing the plugin and cannot seem to replicate your problem.
 * Could you confirm you have your WordPress time zone settings set up correctly?
   You can do this in Settings -> General, we use this to determine your current
   local time rather than the server time which can be inaccurate, if this setting
   is incorrect on your website this would explain why you are having issues with
   the closing time.
 * Thanks
 *  Thread Starter [nawak](https://wordpress.org/support/users/nawak/)
 * (@nawak)
 * [10 years ago](https://wordpress.org/support/topic/problem-shortcode-1/#post-7273464)
 * Hello,
 * yes my config is good
 * UTC+2 for Paris
 * L’heure universelle (UTC) est 2016-05-04 11:46:28 L’heure locale est 2016-05-
   04 13:46:28. => on my computer : 13h46
 * you can see the plugin at the bottom of my website :
    [http://blog.lecomptoirdesvapoteurs.com/a-propos/](http://blog.lecomptoirdesvapoteurs.com/a-propos/)
 * and this part of code :
    <?php elseif( $show_closed === true || $show_closed 
   === ‘true’ ): ?> <dt><?php echo ucwords($day); ?></dt> <dd>Closed</dd> <?php 
   endif; ?>
 * doesnt work if i doesnt set a periode, closed is not displayed.
 * if you add a .po language file i can translate this plugin in french
 * thanks you
 * ++
 *  Thread Starter [nawak](https://wordpress.org/support/users/nawak/)
 * (@nawak)
 * [10 years ago](https://wordpress.org/support/topic/problem-shortcode-1/#post-7273465)
 * I forgot the problem that I have this is without code changes
 * code to display a message if open or closed :
 *     ```
       <?php
       // is_open() function
       if( WPOTP()->is_open() ):
       $imgopen = ''. get_stylesheet_directory_uri() .'/images/icon_open.png';
       print '<img src="' . $imgopen . '" alt="" style="margin-bottom:0px" />';
       echo "Magasins ouvert.<div style='font-size: 12px; important!'>Sauf cas exceptionnel</div><hr \>";
       endif;
   
       // is_closed() function
       if( WPOTP()->is_closed() ):
       $imgclose = ''. get_stylesheet_directory_uri() .'/images/icon_close.png';
       print '<img src="' . $imgclose . '" alt="" style="margin-bottom:0px" />';
       echo "Magasins fermé.<div style='font-size: 12px; important!'>Sauf cas exceptionnel</div><hr \>";
       endif;
       ?>
       ```
   
 *  Thread Starter [nawak](https://wordpress.org/support/users/nawak/)
 * (@nawak)
 * [10 years ago](https://wordpress.org/support/topic/problem-shortcode-1/#post-7273466)
 * and this code for :
 * – add a clock before time
    – translate day in french – replace – by / in bold–
   add letter spacing for day
 * this is the hack but it gives you an idea of what could be quite an improvement
   with the best code ( customise plugin in administration would be great 🙂 )
 *     ```
       <!-- MODIF - Modification de la ligne pour faire prendre en compte les 2 array dans un foreach -->
       <?php foreach(array_combine($dows, $dows2) as $day => $day2): ?>
       <?php if( isset($wpotp_options[$day]) && !empty($wpotp_options[$day]) ): ?>
       <!-- MODIF - Modification de la ligne pour espacer les lettres et prendre la variable $day2 qui est en francais -->
       <dt style="letter-spacing: 3px;"><?php echo ucwords($day2); ?></dt>
       <?php foreach( $wpotp_options[$day] as $slot ): ?>
       <dd>
       <time itemprop="openingHours" datetime="<?php echo substr(ucwords($day), 0, 2); ?> <?php echo $slot['open']; ?>-<?php echo $slot['close']; ?>">
       <?php
       $imghorloge = ''. get_stylesheet_directory_uri() .'/images/icon_clock.png';
       if( $display == '24' ):
       // MODIF - Ajout ligne Print
       print '<img src="' . $imghorloge . '" alt="" style="margin-right:8px" />';
       // MODIF - Remplace le tiret par une barre en gras
       echo $slot['open']." <b>/</b> ".$slot['close'];
       elseif( $display == '12' ):
       $this_open = strtotime($slot['open']);
       $this_close = strtotime($slot['close']);
       // MODIF- Ajout ligne Print
       print '<img src="' . $imghorloge . '" alt="" style="margin-right:8px" />';
       // MODIF - Remplace le tiret par une barre en gras
       echo date('h:ia', $this_open)." <b>/</b> ".date('h:ia', $this_close);
       endif;
       ?>
       </time>
       </dd>
       <?php endforeach; ?>
       <?php elseif( $show_closed === true || $show_closed === 'true' ): ?>
       <dt><?php echo ucwords($day); ?></dt>
       <dd>Ferm&eacute;</dd>
       <?php endif; ?>
       <?php endforeach; ?>
       ```
   
 * sorry for your eyes i’m not a developper 😉
 * ty
 *  Thread Starter [nawak](https://wordpress.org/support/users/nawak/)
 * (@nawak)
 * [10 years ago](https://wordpress.org/support/topic/problem-shortcode-1/#post-7273467)
 * sorry I have found the problem the plugin uses the universal time utc but not
   time UTC+2 of my wordpress
 * L’heure universelle (UTC) est 2016-05-04 12:10:38 L’heure locale est 2016-05-
   04 14:10:38.
 * it use utc not local time with my parameter utc+2
 * any idea ?
 * +++
 *  Thread Starter [nawak](https://wordpress.org/support/users/nawak/)
 * (@nawak)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/problem-shortcode-1/#post-7273521)
 * 🙁

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

The topic ‘problem shortcode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-opening-times-pro.svg)
 * [WP Opening Times Pro](https://wordpress.org/plugins/wp-opening-times-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-opening-times-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-opening-times-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-opening-times-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-opening-times-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-opening-times-pro/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [nawak](https://wordpress.org/support/users/nawak/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/problem-shortcode-1/#post-7273521)
 * Status: not resolved