• Hi Dev friends.

    Im currently loving this plugin, its made my life so easy. I would like to know how can i display images from child posts group fields….i have tried various ways and searched everywhere im down two days and still cant figure this out. Please could you help me it would be greatly appreciated.

    Here is the code im using

    <?php while ( have_posts() ) : the_post(); ?>

    <h1><?php the_field(‘about_your_company’); ?></h1>

    <img src=”<?php the_field(‘business_logo’); ?>” class=”hero-image” />

    <p><?php the_content(); ?></p>

    <?php $child_posts = types_child_posts(‘restaurant-menu’);
    foreach ($child_posts as $child_post) {
    echo $child_post->post_title; echo $child_post->fields[‘food_price’][0]; echo $child_post->fields[‘food_image’][0];
    } ?>

    <?php endwhile; // end of the loop. ?>

    As you can see im building a restaurant menu with repeater fields. Im able to get the post data fields, however the image comes thorough RAW just a URL. i need the image to be an object. I have been trying the wpcf-name, this didnt work, i tried the url=”false” this didnt work either. Unles im doing it wrong, hence im here for advice.

    Im building a mobile app with wordpress as CMS and a themeswitcher for mobile views where the front end will be an “app builder” for clients. Thank you for a great plugin and add-ons, this is really a must have for any new developers looking to explore template design.

    Kind regards
    Wayne -“types biggest new fan” 🙂


  • The topic ‘Query child posts fields’ is closed to new replies.