Custom Post Type Featured Image Archive
-
Hello!
I have created a Custom post Type called “Projects”. I have several custom categories set up under projects. I have successfully set-up Custom Post type archives for single categories but I would like to create an archive that has 2 categories with their child post listed afterwards (called “Kitchens & Baths”). So for instance I would like to set up an archive that has “kitchen-category” and then all posts under kitchen and on the same page underneath have “bath-category” with all post under baths.
Here is a link to the archive which just has one category and posts. I would like to add “baths” underneath this set.
https://sandraschmitt.com/cavdesign/blog/project-type/project-kitchen/
Code for this archive.php page:
<?php get_header(); ?> <div id="main-content"> <h2><?php single_cat_title(); ?></h2> <div id="gridcontainer"> <?php global $query_string; //Need this to make pagination work /*Setting up our custom query (In here we are setting it to show 12 posts per page and eliminate all sticky posts) */ query_posts($query_string . '&caller_get_posts=1&posts_per_page=12'); if(have_posts()) : while(have_posts()) : the_post(); ?> <div class="griditemleft"> <div class="postimage"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('category-thumbnail'); ?></a> </div> <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> </div><!--griditemleft--> <?php endwhile; //Pagination can go here if you want it. endif; ?> </div><!--gridcontainer--> </div><!--main-content--> <?php get_footer(); ?>
I was thinking I would just be able to duplicate the loop with each category somehow specified but I have not had any luck. Not sure I am even using the correct terminology to research correctly. I have been stuck on this for a while unfortunately. Any help would be greatly appreciated.
Thanks!
sandra ??
- The topic ‘Custom Post Type Featured Image Archive’ is closed to new replies.