Support » Plugin: Tabby Responsive Tabs » One too many closing divs when using conditionals

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author cubecolour

    (@numeeja)

    This is an interesting usage. I think I have done something similar before.

    There are a couple of approaches I can think of which might help.

    The first is to output your [tabbyending] shortcode from inside an additional true/false conditional so the shortcode only appears when the same conditions to output the [tabby] shortcodes are true.

    A second approach would be to use a static variable as a flag in the functions that output the [tabby] shortcodes – initialize the flag as false, then whenever a [tabby] shortcode is output, change the value of the flag to true.

    Then check whether the flag is true or false and only output the [tabbyending] shortcode when the flag is true.

    Of course! I will try that, thankyou!

    The first approach worked fine but thanks a lot for taking the time to suggest an alternative.
    In fact that second approach helped me refactor the template, it makes a lot more sense tu use a variable instead of a long repeated conditional.

    Great plugin, and even better support!.
    Cheers!

    Plugin Author cubecolour

    (@numeeja)

    That’s great news – I’m glad that the suggestions were useful.

    If you would like to post a review of the plugin, that would be very much appreciated: https://wordpress.org/support/view/plugin-reviews/tabby-responsive-tabs

    Done!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘One too many closing divs when using conditionals’ is closed to new replies.