Support » Plugin: Toolset Types - Custom Post Types, Custom Fields and Taxonomies » Parent Field Value is not showing.

  • For child field value we use this code in parent:
    <?php echo $child_post->fields[‘price’]; ?>

    How to show parent post field values in child posts?
    I am able to get the title and featured images with this code but dont know how to get custom fields similar like the above child fields?

    Here is my code:
    $parent_id = wpcf_pr_post_get_belongs($post->ID, ‘agent’);
    if (!empty($parent_id)) {
    $parent = get_post($parent_id);

    //title success code
    <?php echo $parent->post_title;?>

    //featured img success code
    $agentPhoto = wp_get_attachment_image_src(get_post_thumbnail_id($parent->ID));
    ” />

    //failed try for custom fields value
    echo types_render_field($parent_id, ‘agent-phone]’);
    }

    Please Help. Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Parent Field Value is not showing.’ is closed to new replies.