Custom Taxonomy Theme
-
Hey there, i have a Custom Taxonomy Theme (taxonomy-listing_category.php) and it displays ALL of my listings, is their a way to make this only display the active slug being viewed?
like i have categories of test1 test2 test3 i want a way to show only the results of the /listing_category/test1/ to be shown when there and the /listing_category/test2/ items to be displayed when on test2 category page
<?php get_header(); $args = array( 'post_type' => 'listing', 'orderby'=>'title', 'order'=>'ASC', 'post_status' => 'publish', 'posts_per_page' => 20 ); ?> <table class="second"> <tr> <td>Company Name</td> <td>Company Profile</td> <td>Country</td> <td>City</td> </tr> <?php $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php $x++; $color = ($x%2 == 0)? 'bg1' : 'bg2'; echo '<tr class="' .$color. '">'; ?> <td width="15%" class="td2"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></td> <td width="15%" class="td2"><?php echo directory_listing_get_meta( 'directory_listing_company_profile' ); ?></td> <td class="td2"><?php echo directory_listing_get_meta( 'directory_listing_country' ); ?> </td> <td width="15%" class="td2"><?php echo directory_listing_get_meta( 'directory_listing_city' ); ?></td> </tr> <?php endwhile; echo '</table>'; wp_reset_query(); get_footer();
thats my page so far wondering how to make it only display each category items with out all of the items thanks in advance
- The topic ‘Custom Taxonomy Theme’ is closed to new replies.