Support » Fixing WordPress » Tags won’t display in posts–Help!

  • Hi,

    I’m revamping a site and when I upgraded wordpress to 2.9.2 and changed the theme, suddenly the post tags stopped displaying.

    I’ve tried all sorts of code snippets and have even changed back to the old theme, but they refuse to show.

    I think that replacing the wordpress file will fix the problem, but I have no idea which file it is!

    Any suggestions?

    The url is


Viewing 15 replies - 1 through 15 (of 19 total)
  • Mr E


    I would be weary of just swapping files in and out of different wp versions, if I understood you properly.

    I see the tags on the widget, are you referring to something different?


    I’d rather not swap files either, but I think it’s a wordpress problem…

    I’m talking about the tags that show at the bottom of individual posts. The tag cloud is fine.

    What else do you think could be wrong?

    Think there’s a plugin that would fix it?




    Forum Moderator

    if a theme shows tags at the bottom of a post (or otherwise) is down to the taste and decision of the theme author. however, you can edit the template files (index.php, single.php …) and add the line that should show the tags:

    for instance, this is the (part of the) code from the default theme:
    <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?></p>

    just locate the place in the code of your template files, where you want to show the tags, and add a code like the above, or similar.

    I understand that.

    However, the theme has that function, but the tags will not show. I’ve added 5 different variations on that code (before I came to this forum) and they still won’t display.

    When the site was running 2.8.6, it showed them. I upgraded to 2.9.2 (automatically) and they no longer show…even with the same theme activated.

    I’m starting to get a little frustrated!

    What else could it be?

    If you switch to the WordPress Default theme do you see the tags on each post?

    No. Even the default theme doesn’t show the tags.

    Do you think that I should replace the wordpress file that appears to be broken? I’d like to try it, but I don’t know which one it is.

    I’ve also tried deactivating all plugins and that isn’t it either…

    Well your tag cloud is working and they link to your tag archives so can’t see why the Default theme, with plugins deactivated, didn’t show the tags for each post.

    Do you think that I should replace the wordpress file that appears to be broken?

    Not really a file you would ‘fix’

    Shoot! It’s weird, isn’t it?

    What would you try next?

    Put this in your loop

    $title = 'Tag ';
    $tags = wp_get_post_tags($post->ID);
      if ($tags) {
        foreach($tags as $tag) {
          echo '<p>' . $title . '<a href="' . get_term_link( $tag, 'post_tag' ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a> has ' . $tag->count . ' post(s). </p> ';


    Still not working! What in the world?!

    Then you’re not in a $post type loop is my guess.

    I put it in the index.php before the <?php endwhile; else: ?>

    Here’s my index.php

    <?php get_header(); ?>
    <?php global $woo_options; ?>
        <!-- #content Starts -->
    	<?php woo_content_before(); ?>
        <div id="content" class="col-full">
        	<div id="main-sidebar-container">
                <!-- #main Starts -->
                <?php woo_main_before(); ?>
                <div id="main">      
    				// Exclude stored duplicates
    				$exclude = get_option('woo_exclude');
    				$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    				$args = array( 'post__not_in' => $exclude,
    							   'category__not_in' => '',
    							   'paged' => $paged );
                <?php if (have_posts()) : $count = 0; ?>
                <?php while (have_posts()) : the_post(); $count++; ?>
                    <!-- Post Starts -->
                    <?php woo_post_before(); ?>
                    <div <?php post_class(); ?>>
                        <?php woo_post_inside_before(); ?>
                        <?php woo_image('width='.$woo_options['woo_thumb_w'].'&height='.$woo_options['woo_thumb_h'].'&class=thumbnail '.$woo_options['woo_thumb_align']); ?> 
                        <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                        <p class="post-meta">
                            <span class="small"><?php _e('by', 'woothemes') ?></span> <span class="post-author"><?php the_author_posts_link(); ?></span>
                            <span class="small"><?php _e('on', 'woothemes') ?></span> <span class="post-date"><?php the_time($GLOBALS['woodate']); ?></span>
                            <span class="small"><?php _e('in', 'woothemes') ?></span> <span class="post-category"><?php the_category(', ') ?></span>
                        <div class="entry">
                            <?php if ( $woo_options['woo_post_content_home'] == "true" ) the_content(); else the_excerpt(); ?>
    $title = 'Tag ';
    $tags = wp_get_post_tags($post->ID);
      if ($tags) {
        foreach($tags as $tag) {
          echo '<p>' . $title . '<a href="' . get_term_link( $tag, 'post_tag' ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a> has ' . $tag->count . ' post(s). </p> ';
                        <?php woo_post_inside_after(); ?>
                    </div><!-- /.post -->
                    <?php woo_post_after(); ?>
                <?php endwhile; else: ?>
                    <div class="post">
                        <p><?php _e('Sorry, no posts matched your criteria.', 'woothemes') ?></p>
                    </div><!-- /.post -->
                <?php endif; ?>  
                    <?php woo_pagenav(); ?>
                </div><!-- /#main -->
                <?php woo_main_after(); ?>
                <?php get_sidebar(); ?>
    		</div><!-- /#main-sidebar-container -->         
    		<?php get_sidebar('alt'); ?>
        </div><!-- /#content -->
    	<?php woo_content_after(); ?>
    <?php get_footer(); ?>

    Does that help? I’ve got my fingers crossed…By the way, I appreciate this more than you know!

    Try putting that inside the loop in the WordPress default theme wp-content/themes/default/index.php. Then if you are using a static front page, undo that setting. T

    It didn’t work when I added it to the default theme either…

    I’m starting to freak out a bit…This is a client’s site. He had tags in his posts, I made him upgrade (he was using 2.8.6) and now no theme will show the tags. A couple of themes do show ‘Tagged with:’, but the line is blank after that.

    I really have absolutely no idea what it could be.

    Before this line

    $tags = wp_get_post_tags($post->ID);


    echo '<p>!!!!!!!!!post id is '.$post->ID . '</p>';

    and see if you get a post id output.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Tags won’t display in posts–Help!’ is closed to new replies.