WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Agnes
    Member
    Posted 2 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); ?>

    http://wordpress.org/extend/plugins/types/

  2. AmirHelzer
    Member
    Plugin Author

    Posted 2 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
    Member
    Posted 2 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

About this Topic

Tags