Tumblr tags are showing below the posts instead of inside the box

tumblrtumblr-themes

I edited a Tumblr layout to show tags on each post but for some reason the tags are showing up below the post boxes, and right above the next post.

The code I have for the layout is as below (truncated):

{block:Posts}
    {block:Text}
       <li class="post text">
           <!-- HTML layout for Text posts -->
       </li>
    {/block:Text}

    {block:Photo}
       <li class="post photo">
           <!-- HTML layout for Photos -->
       </li>
    {/block:Photo}

    {block:Quote}
       <li class="post quote">
           <!-- HTML layout for quotes -->
       </li>
    {/block:Quote}

    {block:Link}
       <li class="post link">
           <!-- HTML layout for link posts -->
       </li>
    {/block:Link}

    <!-- etc. -->

    {block:HasTags}
        {block:Tags}
            <a href="{TagURL}">{Tag}</a>
        {/block:Tags}
    {/block:HasTags}
{/block:Posts}

I can't seem to figure out how/where to edit the theme so the tags show up within the post container and not floating outside and into the next post.

Best Answer

It may be tedious, but it looks like you'll have to include the HasTags block in each of the section types.

Starting with the first you'll end up with this:

    {block:Text}
       <li class="post text">
           <!-- HTML layout for Text posts -->

        {block:HasTags}
            {block:Tags}
                <a href="{TagURL}">{Tag}</a>
            {/block:Tags}
        {/block:HasTags}

       </li>
    {/block:Text}

Where you currently have it appear just before {/block:Posts}, change it to be just before the closing </li> which appears to be what your post container styles are dressed in.

Don't forget to remove the block that appears just before the closing {/block:Posts} or you'll get the tags showing up twice.