I'm trying to make the following mock up with WordPress: https://imgur.com/a/Sem7y
I created a custom post type and I created two categories (general and filling instructions). I used ACF plugin to create custom fields for the post type: https://imgur.com/a/o2QJV
However, when I create the loop I can't get it to show posts for only the general category, it will show any category. Also, it only shows one post (most recent), I want it to show all of them for the one category.
<ul class="pdfLinks"> <?php //The Arguments $args = array( 'posts_per_page' => 50, 'post_type' => 'documents', 'category_name' => 'general' ); //The Query $genral_documents = new WP_Query ( $args ); ?> <?php //If we have the posts... if (the_field ('title')) : while(the_field('title')) : the_field('title'); endwhile; endif; ?> <?php $pdf1 = get_field('pdf_1'); ?> <a class="download_button" target="_blank" href="<?php echo $pdf1['url']; ?>"> <li> Download File </li> </a> </ul>
I'm very new to coding for WordPress, so I'm not sure what I'm doing wrong. Thank you for your help :)