Conditional Check Based on Shortcode Output?

Hi,

I am trying to conditional display an element, but in this case - only show if a shortcode output has elements in it.

In this case, the shortcode is outputting a list of taxonomy terms.

Has anyone figured out a way to use conditions alongside shortcodes?

1 Like

Hi,

In bricks builder i added a code element. If the shortcode has no result then with css i make sure the block does not appear
$shortcode_output1 = do_shortcode(‘[dynamic_title_1]’);

if ($shortcode_output1 == ‘’) {
echo ‘#brxe-lvlcpl { display: none !important; }’;
}