• Resolved studioavanti

    (@studioavanti)


    Hi,
    Is it possible to insert a shortcode as conditional?
    I want to display product attributes and add the attributes label before, so i need a conditional to embed the label and shortcode to hide the label if the product has no attribute.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Unfortunately there are no support for conditional shortcodes but if I understand you correctly, you could use the “before attribute” to show the label. For example, you can use [wcj_product_list_attributes] shortcode as [wcj_product_list_attributes before="Attributes:"]. You can see additional attributes for this shortcode here: https://booster.io/shortcodes/wcj_product_list_attributes/.

    Thread Starter studioavanti

    (@studioavanti)

    Hello,

    Thanks for your answer.

    Too bad, an embeding conditional shortcode would be really helpful, like:

    [wcj_if wcj_list_attributes] 
        Some text 
        [wcj_list_attributes] 
    [/wcj_if]

    Yes, i found the before/after attributes, very handy.

    I finally made a custom shortcode in function.php including conditional.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditional shortcode?’ is closed to new replies.