• Resolved jumust

    (@jumust)


    Hi,
    I have two custom fields A and B with an output filter Wrapper in order to wrap non-empty input.

    <?php
    print_custom_field('phone_number:wrapper', array('<span class="my_class"><strong>A:</strong> ', '</span>') );
    
    print_custom_field('fax_number:wrapper', array('<span class="my_class"><strong>B:</strong> ', '</span>') );
    ?>

    Only if both custom fields are non-empty I would like to add a symbol in between them:
    A – B

    How can I accomplish this?

    Thanks

    http://wordpress.org/extend/plugins/custom-content-type-manager/

Viewing 1 replies (of 1 total)
  • Plugin Contributor fireproofsocks

    (@fireproofsocks)

    If you’re getting that complex with your requirements, use PHP. Write a couple if-statements and be done with it. However, I advocate keeping it simple — the more little tweaky things like that you have, the harder it becomes to maintain your templates and you can end up with a mess on your hands. For me, as a developer, those little things are absolutely not worth it. It may drive your aesthetic tastes crazy, but it’s just one more moving part that can break.

Viewing 1 replies (of 1 total)
  • The topic ‘Wrapper output 2 custom fields with a symbol’ is closed to new replies.