how do I use a if statement on custom press

Hi, how do I add an if statement to my template file?

example, here is my code to add to my theme:
<?php echo do_shortcode('[ct id="_ct_text_56a24bea86e92" property="title | description | value"]'); ?>
.... I want nothing to show when the field is not filled in.

thanks!

  • Adam Czajczyk

    Hello Dann,

    I hope you're well today and thank you for your question!

    The "property" attribute of the shortcode can be either "title", "description" or value and not all three at once. Therefore an example code that would display the value of that field would be:

    <?php echo do_shortcode('[ct id="_ct_text_56a24bea86e92" property="value"]'); ?>

    If the field does not contain any value (was not filled) it shouldn't display anything here. I suppose though that I may be missing something. Could you please share explain a bit what output is that code producing for your and what would be an expected one?

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.