Guides
Tutorials
Pop Tags

Entries

Another collection tag is the <pop:entries> tag. Without a from attribute this tag will display any entries of the current content. Only sections and categories can have entries. If the content being displayed by the template is an entry, the <pop:entries> (without a from attribute) will do nothing. Here’s a simplified example of the typical index page of a blog section:

<!doctype html>
<html>
  <head>
    <title><pop:content.title/></title>
  </head>
  <body>
    <pop:entries>
      <div class="post">
        <h2><a href="<pop:permalink/>"><pop:title/></a></h2>
        <div class="body"><pop:body/></div>
      </div>
    </pop:entries>
  </body>
</html>

As with any other content tag, the from attribute only pulls entries from a specific section. You can also use limit to decide on the number of entries to pull in. This snippet would show you the 3 entries from the blog:

<pop:entries from="blog" limit="3">
  <h2><pop:title/></h2>
  <pop:body/>
</pop:entries>

Just as with <pop:sections>, if you nest the <pop:entries> tag inside another content tag without a from attribute, you’ll get the entries from that content. The following snippet would list all the entries from all the top level sections:

<pop:sections>
  <h1><pop:title/></h1>
  <ul>
    <pop:entries>
      <li><pop:title/></li>
    </pop:entries>
  </ul>
</pop:sections>
Continue to Categories »