Custom Post Taxonomies
-
Hi
I am attempting to display a number of custom taxonomies as I did with categories but the syntax is confusing me (Im not a php wizard ?? ).
This code worked well with the categorys get_category b ut due to admin usability id like to switch over to custom posts type with custom taxonomy.
I have used a plugin to create my custom post types and generate the custom taxonomies, it is calling them in the template I have an issue with.Here is the previous code that worked like a charm with get_category, I have changed the top bit, I’ve been giving this a good go! I realise get_category needs to change to get_taxonomies, but after that I get stuck…
<?php $args=array( 'taxonomy' => 'product_categories', 'orderby' => 'name', 'order' => 'ASC' ); $categories=get_categories($args); foreach($categories as $cat) { echo '<div class="col310">'; echo '<a href="' . get_term_link( $cat->term_id ) . '" title="' . sprintf( __( "View all products in %s" ), $cat->name ) . '" ' . '><img src="' . z_taxonomy_image_url($cat->term_id).'"' . ' />'; echo '<h3><a href="' . get_term_link( $cat->term_id ) . '" title="' . sprintf( __( "View all products in %s" ), $cat->name ) . '" ' . '>' . $cat->name.'</a></h3> '; echo '<p>'. $cat->description . '</p>'; echo '<a href="' . get_term_link( $cat->term_id ) . '" title="' . sprintf( __( "View all products in %s" ), $cat->name ) . '" class="link"' . '><img src="' . get_template_directory_uri().'/images/cat-arrow.png" width="17" height="17" alt="View"' . ' /></a>'; echo '</div>'; } ?>
Any help is much appreciated!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom Post Taxonomies’ is closed to new replies.