Support » Plugin: Timed Content » weekdays/opening hours

  • Resolved andersnielsen1

    (@andersnielsen1)


    Is there a way to create a rule for “office hours”

    I can create a rule for the time 8:00 – 18:00 everyday… but weekends needs to be “off” to.

    Example: I use it for showing my phone number when we are open, and a “lets call you” button when we are closed.

    But I can’t see how..?

    Another little thing, I have tried deleting a rule from the trash, and got this error:

    
    Warning: Illegal string offset 'date' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 2253
    
    Warning: Illegal string offset 'date' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 2255
    
    Warning: Illegal string offset 'date' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 2256
    
    Warning: Illegal string offset 'date' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 2259
    
    Warning: Illegal string offset 'date' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 2261
    
    Warning: Illegal string offset 'date' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 2262
    
    Warning: Illegal string offset 'time' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 2265
    
    Warning: Illegal string offset 'time' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 2265
    
    Warning: Illegal string offset 'time' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 2267
    
    Warning: Illegal string offset 'time' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 2267
    
    Warning: Illegal string offset 'date' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 737
    
    Warning: Illegal string offset 'date' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 741
    
    Warning: Illegal string offset 'date' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 750
    
    Warning: Illegal string offset 'time' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 753
    
    Warning: Illegal string offset 'date' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 756
    
    Warning: Illegal string offset 'time' in /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php on line 759
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php:2253) in /var/www/xx.dk/public_html/wp-admin/includes/misc.php on line 1196
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php:2253) in /var/www/xx.dk/public_html/wp-includes/pluggable.php on line 1251
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/xx.dk/public_html/wp-content/plugins/timed-content/timed-content.php:2253) in /var/www/xx.dk/public_html/wp-includes/pluggable.php on line 1254
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    To create a rule for every day except weekends you need to set the repeating pattern to “weekly” and check all the days, where the rule should apply. In your case all days except Sunday and Saturday.

    About the warnings when deleting a rule from the trash: I’ll have a look into this and publish an update as soon as possible.

    Plugin Author Arno Welzel

    (@awelzel)

    Unfortunately I can not reproduce the problem with the warnings. I create a rule, edit it, publish it. Then I delete it and also delete it from the trash – no warnings at all.

    Your error message looks like the database got corrupted, so meta data for the rules got removed before it got completely deleted from the trash.

    Can you please try this once more if it happens again?

    ok, seems to work.. Maybe it was a rule from the previous version, which had some warnings in the backend, when activated.

    Plugin Author Arno Welzel

    (@awelzel)

    Thank you for the feedback.

    Does the weekly repeating with day selection work for you? Also see “Show projected dates/times” in the backend.

    yes, it works – but the setup could be more “clean”

    I have a rule for office time
    out of office time
    And weekends

    3 rules.

    Could be nice with a “in office time rule”, and “out of office time” (where you can selects days, and time for all days individually)

    But it works

    Plugin Author Arno Welzel

    (@awelzel)

    The problem is – even with specific times for every single day you still need two rules, since you need to distinguish, when to show the “in office” content and when to show the “out of office” content. So you need two rules anyway – one to show the content during office hours, the other one to show the content for the out of office time.

    [timed-content-rule id="1"]In the office[/timed-content-rule]
    [timed-content-rule id="2"]Out of office[/timed-content-rule]

    Rule 1: Show content 08:00-18:00, repeat weekly, Monday-Friday
    Rule 2: Hide content 08:00-18:00, repeat weekly, Monday-Friday

    So when rule 1 applies during office hours, the “In the office” block will be visible. At the same time rule 2 will hide the “Out of office” block. As soon as “In the office” will not show anything any longer, the “Out of office block” will apply since it hides content only during office hours.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.