exclude a cutom field from displaying

Is there a way to use the “<?php echo do_shortcode(‘[custom_fields_block]‘:wink:; ?>” code AND display all but one of the custom fields? We currently have nineteen custom fields and want them all to display in a post, except for one. It’s just for the admin’s use.

The site is still under development so I want any future custom fields to be automatically displayed. We just know that there is one particular field that we will never want the public to see.

  • Arnold
    • El Macho WP

    Yes. If you look at the definition of the custom_fields_block you’ll see you can put a list of field IDs in it.

    [custom_fields_block] _ct_selectbox_4cf582bd61fa4, _ct_text_4cfeb3eac6f1f,... [/custom_fields_block]

    Just leave out the field you don’t want

  • smayernik
    • WPMU DEV Initiate

    thank you Brian, but I do not believe that using css would work since all the fields would have the same style.

    thank you Arnold, I was hoping to avoid that route, since the site is still under development…. I wanted to be able to tell it to display all the fields except ‘this one’, so that as more fields were added they would automatically be included.

    Since it doesn’t appear that is possible can you confirm the code:

    <?php echo do_shortcode('[custom_fields_block] _nameof_a_custom_field, _nameof_yet_anothercustom_field,... [/custom_fields_block]'); ?>

    is this correct?

    Future development suggestion: Check box to hide specific custom fields from public.

    Thanks again!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.