This may be a basic question but i cant seem to find a correct solution.
In advanced custom fields I have set up a Field Group CD, in CD there are three fields, title, info, author and the group shows if the category = CD
Therefore when i make a new post with category CD I fill these three fields. There are 10 Posts in the CD categories.
Now the issue I am having is displaying all the posts on a page.
Here is the code I tried
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php query_posts( array( 'posts_per_page' => -1, 'cat' => '6', 'CD' => ( get_query_var('CD') ? get_query_var('CD') : 1 ), ));
if (have_posts()) {
while (have_posts()) {
the_post();
get_post_meta();
} // end while
} // end if
?>
<?php endwhile; endif; ?>
This returned an error Warning: Missing argument 1 for get_post_meta(), called in /Volumes/shared/Digital/_Websites/londonconchord/wp-content/themes/conchord/t-disc.php on line 25 and defined in /Volumes/shared/Digital/_Websites/londonconchord/wp-includes/post.php on line 1792
I tried a different attempt
<p><?php query_posts( 'cat=6' );
the_field('title');
the_field('info');
the_field('author'); ?></p>
I had more luck here as I was printing some information, however only the 1st post in the category and it kept repeating, i wanted all 10 posts and no repeat.
I think im close just looking for those final pointers
Thanks