Toolset Types
[resolved] [Plugin: Types - Custom Fields and Custom Post Types Management] Render a field with condition &quot (3 posts)

  1. Agnes
    Posted 4 years ago #

    I would to render a field with a condition "if not empty", and also to break a line only of the field is not empty.

    The basic code enables do the 1st part, but not the second.
    Any idea?

    <?php echo(types_render_field("object-date", array("show_name" => "true" ))); ?>

    I woudl try with the normal WP grammar, but I wonder why the normal WP code does not render the fields values

    <?php get_post_meta($post->ID, 'object-date', true); ?>


  2. Amir Helzer
    Plugin Author

    Posted 4 years ago #

    Types adds the prefix 'wpcf-' to the custom field names. Try adding this and you should get the field correctly with the WordPress call.

  3. Agnes
    Posted 4 years ago #

    Right, that works !
    I knew that was in the table as a normal custom field and could not get why it does not render, only wathcing the table you find out

    Thanks! Agnes

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Toolset Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic