Support

Account

Home Forums General Issues Show Custom Field results from one post type in template of another Reply To: Show Custom Field results from one post type in template of another

  • Hi @andisaleh

    Thanks for your reply, but I am still really struggling with this. Not sure where that code you provided should go. Where would it fit in relation to my full query/code here…

    <?php
         $args=array(
         'post_type' => 'book',
         'post_status' => 'publish',
         'posts_per_page' => 12,
         'caller_get_posts'=> 1,
         'orderby'=> 'date',
         'order' => 'DESC'
         );
         $my_query = null;
         $my_query = new WP_Query($args);
         if( $my_query->have_posts() ) {
         echo '';
         $i = 0;
         while ($my_query->have_posts()) : $my_query->the_post();
         if($i % 6 == 0) { ?>
    <div class="row">    
    <?php
    }
    ?>
    
    <img src="<?php the_field('cover_image'); ?>" /><br />
    <?php the_field('author_name'); ?><br />
    <?php the_title(); ?><br />
    
    </div>
    
    <?php    
    if($i % 6 == 0) { ?> 
    
    <?php
    }
    
    $i++;
    endwhile;
     } 
    wp_reset_query();
    ?>

    Any help appreciated.