• Resolved Pedro Magnifico

    (@pedro-magnifico)


    I am trying to display text as follows:

    We will be open on May 21 & 24

    with “21 &” being hidden after 5 pm on May 21, and the entire line being hidden after 5 pm on May 24.

    I have tried:

    [time-restrict off=”2017/05/24 17:00:00″]We will be open on May [time-restrict off=”2017/05/21 17:00:00″]21 & [/time-restrict]24[/time-restrict]

    This displays as “We will be open on May 21 & 24[/time-restrict]” and does not hide “21 &” when the date has passed.

    [time-restrict off=”2017/05/24 17:00:00″]We will be open on May [time-restrict-2 off=”2017/05/21 17:00:00″]21 & [/time-restrict-2]24[/time-restrict]

    This displays as: “[time-restrict off=”2017/05/24 17:00:00″]We will be open on May [time-restrict-2 off=”2017/05/21 17:00:00″]21 & [/time-restrict-2]24[/time-restrict]” and does not hide “21 &” when the date has passed.

    Interestingly, the second version also displays in a different font than the first, which displays in the proper page font.

    Any advice would be greatly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dave Clements

    (@thewanderingbrit)

    It should be in the form:

    [time-restrict on="2017/05/21 17:00:00" off="2017/05/24 17:00:00"]We will be open on May 24[/time-restrict][time-restrict off="2017/05/21 17:00:00"]We will be open on May 21 & 24[/time-restrict]

    These are two separate conditions and you can’t nest these shortcodes inside one another, so you need a shortcode for each condition.

    • This reply was modified 7 years, 9 months ago by Dave Clements. Reason: add'l line break
    Thread Starter Pedro Magnifico

    (@pedro-magnifico)

    Thanks Dave!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help with nesting shortcodes?’ is closed to new replies.