WordPress.org

Ready to get started?Download WordPress

Forums

Display Custom Post Type's Categories (2 posts)

  1. Red Deer Web Design
    Member
    Posted 1 year ago #

    Guys, I'm getting more and more confused as I read more. lol. I need some help please!

    I have 4 different custom post types. Each post type has a custom taxonomy where I can give it it's own categories. (I'm using Types plugin to add custom post types/taxonomy fyi).

    When someone clicks a custom post type, I want the first page to display a category list - not the post lists. After they click the category, then it goes to the posts for that category.

    I had it working with just normal posts/categories, but now that there are custom post types and taxonomies I'm getting lost. Any help would be great!

  2. Red Deer Web Design
    Member
    Posted 1 year ago #

    I was previously using this code to display the category list:

    <?php
    				get_query_var( $var );
    				$category_children = get_query_var('cat');
    				echo $category_children;
    
    				$args=array(
    					'child_of' => $category_children
    				);
    
    				$cats = get_categories($args);
    				foreach ($cats as $cat) { ?>
    				<div class="post">
    					<div class="column_01">
    						<img src="<?php bloginfo('template_url');?>/images/place-holder.png" alt="place-holder" width="174" height="174">
    					</div>
    					<div class="column_02">
    				<?php
    						$cat_id= $cat->term_id;
    						echo "<h3>".$cat->name.": "."</h3>";
    						echo category_description($cat_id);
    						?>
    					</div>
    					<a href="<?php echo get_category_link($cat_id) ?>"><p class="goto_page">View All Fire Rated Products</p></a>
    				</div>
    				<?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.