suefeng
2/1/2019 - 7:17 PM

WordPress Custom Post Type Tutorial

<?php
query_posts('showposts=1&post_type=feedback&paged='.$paged);
while ( have_posts() ) : the_post();
$terms = get_the_terms($post->ID, 'group');
?>
       <article class="divider">
           <h4><?php the_title(); ?><span class="comment-bubble"><?php comments_popup_link('0', '1', '%'); ?></span></h4>
          <time class="date" datetime="<?php echo date("Y-m-d", strtotime(get_the_date())); ?>"><?php echo the_date("M d, Y"); ?></time>
          <div class="entry">
         <?php echo the_content(); ?>
          </div>
            <span class="meta">
             Posted in <a href="/group/<?php foreach($terms as $term){echo strtolower($term->name);} ?>/"><?php foreach($terms as $term){echo $term->name;} ?></a>
               | <a href="<?php the_permalink(); ?>">Comment</a>
           </span>
       </article>
<?php
endwhile; ?>