I was updating my template recently when I discovered an odd error. I have a closing {/block:Regular}
at the top of my posts block but no corresponding opening Regular tag.
This seems to output inside every post type even if the content is empty (I would normally use this to capture Text posts).
When I add the {block:Regular}
tag above it, it seems to break my theme.
Without it my theme works correctly.
Here is the top part of the posts block
<div id="contents"><!-- contents -->
{block:Posts}
<div class="post">
<div class="content text">
{block:Title}<h3><a href="{Permalink}">{Title}</a></h3>{/block:Title}
<div class="go">
{Body}
</div>
{/block:Regular}
{block:Photo}
</div>
<div class="content image">
{LinkOpenTag}
<img src="{PhotoURL-500}" {block:HighRes}style="display:none"{/block:HighRes} />
{block:HighRes}
<img src="{PhotoURL-HighRes}" class="highres">
{/block:HighRes}
{LinkCloseTag}
{block:Caption}
<div class="description">{Caption}</div>
{/block:Caption}
<p>
<span class="ion-ios-infinite-outline"></span>
<a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
</p>
{/block:Photo}
{block:Photoset}
</div>
<div class="content photoset">
{block:Photos}
<img src="{PhotoURL-500}" {block:HighRes}style="display:none"{/block:HighRes} />
{block:HighRes}
<img src="{PhotoURL-HighRes}" class="highres" />
{/block:HighRes}
{block:Caption}
{Caption}
{/block:Caption}
{/block:Photos}
{block:Caption}
<div class="description">{Caption}</div>
{/block:Caption}
<p>
<span class="ion-ios-infinite-outline"></span>
<a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
</p>
{/block:Photoset}
{block:Quote}
</div>
<div class="content quote">
<div class="symbol">“</div>
<div class="quote">
{Quote}
</div>
{block:Source}
<div class="description">— {Source}</div>
{/block:Source}
<p>
<span class="ion-ios-infinite-outline"></span>
<a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
</p>
{/block:Quote}
{block:Link}
</div>
And although my blog displays correctly the <div class="content text">
gets inserted to the top of every post.
I have tried a couple of things to wrap the Regular tag properly but I think something else must be broken inside my template as although it looks OK in the browser, it's definitely bust in the console.
Have tried
<div class="post">
{block:Regular}
<div class="content text">
{block:Title}<h3><a href="{Permalink}">{Title}</a></h3>{/block:Title}
<div class="go">
{Body}
</div>
{/block:Regular}
{block:Photo}
</div>
<div class="content image">
With this markup though the posts are being rendered outside of my <div id="container">
See here:
I have also tried replacing {block:Regular}
with {block:Text}
and the corresponding closing tags and seems to be the same issue.
I cannot find a non closed tag, so I am fairly certain the markup is correct, but maybe I am missing something.
If anyone wants the full template I will add it to a jsfiddle.
Well I managed to solve it, by crook or hook as they say.
My markup now looks like this:
I must have inherited the
{Block:Regular}
statement from the original template and not known what it was. But I also had a non closed tag somewhere. I also converted the posts blocks to an ordered list, so semantically it's a bit clearer.Now the output looks like this: