treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Show drop down for category specific tags.

  • I need to show tags associated with each category. This works on my local machine, but when I go live, it will only show 1 tag.

    function drop_tags()
    {
    echo "<select id='example' onChange=\"document.location.href=this.options[this.selectedIndex].value;\">";
    echo "<option id='space'>Select a Tag</option>\n";
    foreach (get_the_tags() as $tag)
    {
    echo "<option value=\"";
    echo get_tag_link($tag->term_id);
    echo "\">".$tag->name."</option>\n";
    }
    echo "</select>";
    }


    This is what I place in my archive file

    <?php drop_tags(); ?>
  • I know this might seem silly, but I'd double check to make sure there is actually more than one tag on the live version (sometimes I forget to copy the database over and wonder why certain categories aren't showing, etc).
  • I actually went through and tagged all the post before and the tags show up on each post. I just cant get all of them to show up in the drop down.