Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //list terms in a given taxonomy (useful as a widget for twentyten)
- $taxonomy = 'productscat';
- $tax_terms = get_terms($taxonomy);
- ?>
- <ul>
- <?php
- foreach ($tax_terms as $tax_term) {
- echo '<li>' . '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a></li>';
- }
- ?>
- </ul>
- <?php
- $args = array(
- 'post_type' => 'products',
- 'category' => product-test-cat-1,
- 'posts_per_page' => -1,
- );
- $loop = new WP_Query( $args );
- while ( $loop->have_posts() ) : $loop->the_post();
- ?>
- <a href="<?php the_permalink(); ?>"><?php the_title();?></a>
- <?php echo '<div class="entry-content">';
- the_post_thumbnail('thumbnail');
- the_excerpt();
- echo '</div>';
- endwhile;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement