• Resolved germanteca

    (@germanteca)


    Hey there! I’m wondering if there’s a way to do this:

    Display a content if time condicion is true.
    Display another content if time condition is false

    I’m currently creating two rules to do that.
    Thanks in advance,

    Germen

Viewing 1 replies (of 1 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    I’m sorry, but this is not possible. Shortcodes in WordPress only have one block of content inside it and there is no way to split this up into two blocks.

    One way might be to introduce some kind of special HTML comment which marks the split like this:

    [timed-content-server ...]
    
    Content if the rule applies.
    
    <!-- timed-content-server-else -->
    
    Some other content if the rule does not apply.
    
    [/timed-content-server]

    Well – this is not very intuitive and you would still need to add this special comment inside your content manually. Having another “shortcode-like” thing inside to split the content is not possible due to the way how shortcodes are handled in WordPress

    • This reply was modified 6 years, 3 months ago by Arno Welzel.
Viewing 1 replies (of 1 total)

The topic ‘If else timing condition.’ is closed to new replies.