ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

[SOLVED] A bug with {count}... kinda

December 15, 2009 2:50pm

Subscribe [0]
  • #1 / Dec 15, 2009 2:50pm

    nZac

    95 posts

    {exp:weblog:entries orderby="date" sort="desc" month_limit="20"   limit="10" }
     {if count == 1}
        <h1>Entries for {entry_date format="%F of %Y "}</h1>
     {/if}
      <h3><a href="http://{permalink}">{title}</a> </h3>
    <p>  <h5 class="article-date">{entry_date format="%F %d, %Y"}</h5><br />
        {summary}<br />
    {/exp:weblog:entries}

    Sometimes it displays the H1 tag sometimes it does’t.  Any idea why?  Could this method be refined?

  • #2 / Dec 15, 2009 2:54pm

    Lisa Wess

    20502 posts

    Use:

    {if count == "1"]

    note the quotes around 1.

  • #3 / Dec 15, 2009 3:21pm

    nZac

    95 posts

    Wow, I am really that daft of a developer.  I might as well give it all up now 😊

    Thanks Lisa!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases