hemingway-post

{* variables for conditional styling *}
{if $smarty.server.SCRIPT_NAME == "/wp-inst/pages"}
  {capture name='z_post_title_cap'}{single_post_title}{/capture}

  {assign var='z_post_category' value="Page"}
  {assign var='z_post_title' value=$smarty.capture.z_post_title_cap}

{elseif $smarty.server.REQUEST_URI == "/"}
  {assign var="z_post_title" value="Homepage"}
  {assign var="z_post_category" value="Homepage"}

{elseif $smarty.server.REQUEST_URI|truncate:10:"":1 == "/category/"}
  {capture name='z_post_title_cap'}{single_cat_title}{/capture}
  {capture name='z_post_category_cap'}{single_cat_title}{/capture}

  {assign var='z_post_title' value=$smarty.capture.z_post_title_cap}
  {assign var='z_post_category' value=$smarty.capture.z_post_category_cap}

{elseif $smarty.request.s != ""}
  {assign var='z_post_title' value=$smarty.request.s }
  {assign var='z_post_category' value="Search"}

{elseif $smarty.request.name == ""}
  {* Date Archive Page *}

  {if $smarty.request.day != ""}
    {* Daily Archive *}
    {capture name='smt'}{single_month_title prefix=' '}{/capture}

    {assign var='z_post_title' value=$smarty.request.day|regex_replace:"/^0/":" "|cat:$smarty.capture.smt}
    {assign var='z_post_category' value="Daily_Archive" }

  {elseif $smarty.request.monthnum != ""}
    {* Monthly Archive *}
    {capture name='z_post_title_cap'}{single_month_title prefix=' '}{/capture}

    {assign var='z_post_title' value=$smarty.capture.z_post_title_cap}
    {assign var='z_post_category' value="Monthly_Archive"}

  {else}
    {* Must be a Yearly Archive then! *}
    {assign var='z_post_title' value=$smarty.request.year}
    {assign var='z_post_category' value="Yearly_Archive"}
  {/if}

{else}
  {* Single Post or Unknown *}
  {capture name='z_post_title_cap'}{single_post_title}{/capture}
  {capture name=cats}{the_category seperator=","}{/capture}

  {assign var='z_post_title' value=$smarty.capture.z_post_title_cap}
  {assign var='z_post_category' value=$smarty.capture.cats|strip_tags:false}
  {assign var='z_single_post' value="true"}

{/if}

{if $smarty.server.REQUEST_URI == '/'}
{* main page *}
{if $one != 'false'}
  {if $second != 'false'}
<!--first column on main page-->
    <div class="story first {is_aside} {if $is_aside=='true'} Asides{/if}">
      <h3><a href="{permalink_link}" rel="bookmark" title="Permanent Link to {the_title_rss}">{the_title}</a></h3>
      {the_excerpt}
      <div class="details">
        Posted at {the_time d='m/d/Y g:i a'} | {comments_popup_link zero='Comments (0)' one='Comments (1)' more='Comments (%)'} <br /><br />Filed Under: {the_category seperator=", "} | <span class="read-on"><a href="{the_permalink}">read on</a></span>
      </div><!--details-->
    </div><!--.story first-->
    {assign var='second' value='false'}
  {else}
    <!--second column on main page-->
    <div class="story {is_aside} {if $is_aside=='true'} Asides{/if}">
      <h3><a href="{permalink_link}" rel="bookmark" title="Permanent Link to {the_title_rss}">{the_title}</a></h3>
      {the_excerpt}
      <div class="details">
        Posted at {the_time d='m/d/Y g:i a'} | {comments_popup_link zero='Comments (0)' one='Comments (1)' more='Comments (%)'} <br /><br />Filed Under: {the_category seperator=", "} | <span class="read-on"><a href="{the_permalink}">read on</a></span>
      </div><!--details-->
    </div><!--.story first-->
    {assign var='one' value='false'}
  {/if}
{/if}

{elseif $z_post_category == "Page"}
      <h1 class="post-title"><a href="{$smarty.server.REQUEST_URI}" rel="bookmark" title="Permanent Link: {single_post_title}">{single_post_title}</a></h1>
      {$content}
    </div><!--.primary-->
    <hr class="hide" />
    <div class="clear"></div>
  </div><!--.inside-->
<!-- [END] #primary -->

{elseif $z_single_post == "true" || $smarty.request.s != ""}
{* end of main page *}
    <a class="toggle" href="#" id="toggle" onclick="return menu.toggle();">&#9003;</a>
    <div class="primary">
      <h1 class="post-title"><a href="{permalink_link}" rel="bookmark" title="Permanent Link: {the_title_rss}">{the_title}</a></h1>
      {the_content more_link_text="Read the rest of the story..."}
    </div><!--.primary-->
    <hr class="hide" />
    <div class="secondary">
      <h2>About this entry</h2>
      <div class="featured">
        <p>You&rsquo;re currently reading &ldquo; {the_title},&rdquo; an entry on  {bloginfo show='name'}</p>
        <dl>
          <dt>Published: </dt>
          <dd>{the_date} {the_time}</dd>
        </dl>
        <dl>
          <dt>Category:</dt>
          <dd>{the_category separator=', '}</dd>
        </dl>
        {edit_post_link link='Edit this entry.' before='<dl><dt>Edit: </dt><dd> ' after='</dd></dl>'}
      </div><!--.featured-->
    </div><!--.secondary-->
    <div class="clear"></div>
  </div><!--.inside-->
</div><!--#primary-->
<!-- [END] #primary -->

{else}
{* archive pages *}
   <li>
     <span class="date">{the_time d='m/d/Y g:i a' }</span><a href="{the_permalink}">{the_title}</a> posted in {the_category separator=', '}
   </li>
{/if}

Leave a Reply