Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // List posts by taxonomy term
- $taxonomy = 'madeof';
- $terms = get_terms($taxonomy);
- foreach ($terms as $term) {
- $args = array(
- 'post_type' => 'post',
- 'ignore_sticky_posts' => 1,
- 'posts_per_page' => -1,
- "$taxonomy" => $term->name,
- 'orderby' => 'title',
- 'order' => 'ASC',
- );
- $q = new WP_Query($args);
- if ($q->have_posts()) { ?>
- <h1><?php echo $term->name; ?></h1>
- <table>
- <?php while ($q->have_posts()) {
- $q->the_post(); ?>
- <tr>
- <td><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></td>
- <td>
- <?php if(get_post_meta($post->ID, 'Author', true)) {
- echo get_post_meta($post->ID, 'Author', true);
- } ?>
- </td>
- </tr>
- <?php } ?>
- </table>
- <?php }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement