10

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.

0

3 Answers 3

5

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.

4
  • That makes sense to me, however, it's still not working. I wonder if there's something else in the coding that's overriding it? Here's my edited version: pastebin.com/DsEdvxSY
    – JammerLea
    Commented Aug 15, 2011 at 5:03
  • Btw, just to add, I was helping a friend with the same problem on one of her tumblr layouts and that method DID work, but I had to place it within some div coding. Just to share what that looked like, I'm too tired to analyze the div coding atm. pastebin.com/8sdatk0V
    – JammerLea
    Commented Aug 15, 2011 at 5:17
  • Looks like in your template you'll have to put the code just before the tag that finishes the style block. @jam Commented Aug 15, 2011 at 11:51
  • ...why didn't I think of that? Yes! That worked! Thank you so much for your help and time. I really appreciate it!
    – JammerLea
    Commented Aug 15, 2011 at 13:14
1

this worked with me but i'm not sure if it will work the same for you, paste:

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

{/block:Posts}

just after the opening of the notecount tag, so after {block:PostNotes} so it it looks a little something like:

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

{/block:Posts}<center>{block:RebloggedFrom}reblogged from <a href="{ReblogParentURL}">{ReblogParentName}</a><br>{/block:RebloggedFrom}
{block:ContentSource}posted by <a href="{SourceURL}">{SourceLink}</a></br>{/block:ContentSource}</center>
{PostNotes}
{/block:PostNotes}

this should ensure that tags are shown within the post box

1

Put it right below the {block:post} instead of right above the {/block:post}

so...

{block:post}

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

(all the different types of posts}
{/block:post}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.