This is my first time working with custom post types and custom taxonomies so please bare with me if this sounds ridiculous.
I've already created this site in php but now im converting it to wordpress.
I've made the following for wordpress:
Custom post type: "
Custom taxonomy: "
Term under all_park_categories (i.e., categories I have made for this custom taxonomy):
National Parks, National Forests, National Recreational Areas
I want to query the custom post type by taxonomy term/category and then list them in a table
So far its working, BUT the table isn't printing correctly and I don't know how to group them by their term/category. Ideally I would have 3 different tables (1 for each term/category)
<?php $args = array( 'post_type' => 'all_parks', 'posts_per_page' => -1, 'orderby' => 'name', 'order' => 'ASC', 'style' => 'list', ); $all_parks = new WP_Query( $args ); while ( $all_parks->have_posts() ) : $all_parks->the_post(); ?> <table> <tr> <tr> <th>State</th> <th>Park Name</th> </tr> <tr> <td><a href="/all-states/<?php the_field('state'); ?>/"><?php the_field('state'); ?></a></td> <td> <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p> </td> </tr> </table> <?php endwhile; ?>