• Resolved looplander

    (@looplander)


    Hi,
    I want to display a tab only if a taxonomy checkbox (y) has been ticked.
    any help appreciated.

    Standard

    <?php echo do_shortcode(“[tabby title=My Tab]”); ?>

    Conditional – if checkbox has been ticked then display tab – something like

    <?php
    if(taxonomy_exists(‘myTaxonomy’)){
    echo do_shortcode(“[tabby title=My Tab]”);
    }
    ?>

    https://wordpress.org/plugins/tabby-responsive-tabs/

Viewing 1 replies (of 1 total)
  • Plugin Author cubecolour

    (@numeeja)

    The <?php echo do_shortcode("[tabby title=My Tab]"); ?> is the correct way to include a tab within a theme’s template. This should work inside an if statement, but you will need to ensure that the resultant shortcode structure is correct – including the [tabbyending] shortcode following the last tab’s content.

    You probably need to ensure that your conditional statemement is working by including something like a span with a hotpink background then once that code is working so the span is being output in the front end replace it with the shortcode statement.

Viewing 1 replies (of 1 total)

The topic ‘conditional tab display –’ is closed to new replies.