Forums

Tags Not Showing (2 posts)

  1. Dirge2000
    Member
    Posted 3 years ago #

    Ok. So I'm stuck! I just want my tags to show up, but for some reason, they don't. The relevant code is here:

    <div id="posts">
            <ul>
              <?php query_posts('showposts=5'); ?>
              <?php $posts = get_posts('numberposts=5'); foreach ($posts as $post) : start_wp(); ?>
              <li>
                <div class="divider">&nbsp;</div>
                <div class="date">
                  <h4><?php the_time('d'); ?><strong><?php the_time('M'); ?></strong></h4>
                  <h5><?php the_time('h:i:s'); ?></h5>
                </div>
                <div class="post">
                  <h2>
                    <?php the_title(); ?>
                  </h2>
                  <?php the_content(); ?>
                  <?php
         the_tags('<ul class="keywords"><li>','</li><li>','</li></ul>');
    ?>
                </div>
                <div class="divider">&nbsp;</div>
              </li>
              <?php endforeach; ?>
            </ul>
          </div>

    What gives?

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    //this is necessary to show the tags
    global $wp_query;
    $wp_query->in_the_loop = true;
    the_tags();

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags