WordPress.org

Ready to get started?Download WordPress

Forums

Adding the_tags to theme not showing up (2 posts)

  1. mjulson
    Member
    Posted 6 years ago #

    I have an odd issue I can't figure out.

    I'm trying to modify my theme so it shows the tags for that post at the bottom of a post. I've added the function to the bottom of the post on the single.php page and it works perfectly by showing the tags.

    On index.php however, I paste the same exact code and it does not show the tags at all. No errors either. The code I'm using is:

    <?php the_tags('Tags: ', ', ', ' '); ?>

    Pasted here..

    <div class="entry">
    <?php the_content('Continue Reading &raquo;'); ?>
    <?php the_tags('Tags: ', ', ', ' '); ?>
    <?php wp_link_pages(); ?>
    </div>

    I've added the word test after the function and it shows up on the home page where I expect the tags, so I know I'm modifying the right theme/page.

    Any thoughts? I'm stumped.

  2. MichaelH
    Member
    Posted 6 years ago #

    The Template Tag, the tags(), must be used in The Loop. The 2.3 version of the WordPress 1.6 Default theme has an example you can look at in wp-content/themes/default/index.php.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags