Creating a directory with Categories and Titles under that category
-
I created a custom post type and added categories to the custom post. My goal is to create a custom post ‘Resource’ and then categories and multiple titles.
Appraisal Company:
??Title one
??Title two
??Title Threebut what I get is :
Appraisal Company
??Title 1Appraisal Company
? Title 2Any help would be much appreciated.
<!-- beginning of the directory --> <?php $loop = new WP_Query( array( 'post_type' => array('Resources'), 'posts_per_page' => 8, 'order' => ASC,) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <div id="resource"> <div <?php post_class( '', $tag_id ); ?>> <h3 class='<?php the_ID(); ?>'> <?php $category = get_the_category(); echo $category[0]->cat_name; ?> </h3> <p> <?php foreach((get_the_category()) as $category) { echo $category->category_description . ' '; } ?> </p> <ul> <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> </ul> </div> </div> <?php endwhile; ?> <?php wp_reset_query(); ?> <!-- #end of the directory -->
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Creating a directory with Categories and Titles under that category’ is closed to new replies.