Template tag has been introduced in W4 post list plugin in version 1.4. These tags are used when admin create or update a list option. These tags are parsed to its specific value when the a list get viewed/displayed as like WordPress Shortcodes.
For a easy understanding i could say that, the way WP Shortcodes are placed inside post/page content wrapping with third bracket ([shortcode]), and W4 post list template tags are placed the same way.
General tags
postlist -
The complete post list HTML. Wrap you post list inside one or many HTML layer and display.
postloop -
Post Template Loop. While displaying posts, every post go through the postloop once.
catloop
Category Template Loop. While displaying categories, every category go through the catloop once.
Category tags
category_title -
Category title template
category_count -
Category item count
category_posts -
Posts inside this category. If you remove this field from post list template, And using post category list type, selected posts wont be visible
Post tags
postloopcontains the Post Loop Template. If u want to show posts as list, use ol or ul to wrap the postloop. Loop template contains certain loop elements
title -
Post title template
meta -
Meta template. Ex: Posted on date by author
publish/date -
Post publishing date template
modified -
Post last update date template
author -
Post author template linked to author url
excerpt -
Post excerpt template
post_excerpt -
Raw Post excerpt without wrapper. By default plugin wrap it with a html div
content -
Post content template
content -
Raw Post content without wrapper
more -
Read more template
… Additional Post tags
id|ID -
Post ID
link or post_permalink -
Post permalink url address
publish/date -
Post publishing date
post_title -
Raw Post Title Without link
post_author -
Post author name
post_author -
Post author url address
Examples
Post list is designed to match it to your theme. However, you have to understand where are you using it and what type of list do you need.
My first example is to create a list like the post archive page of tweentyten theme. Below is the HTML design code for this.
Post Archive example- Tweentyten theme
First, create a list and select some posts. Then use below codes for specific fields.
Code for Template Wrapper -
we are not wrapping our list with any kind of html here
Code for Post Template Wrapper -
[postloop]
again, no wrapping
Code for Post Template Loop -
<div class="post-[id] hentry" id="post-[id]"> <h2 class="entry-title"><a rel="bookmark" title="Permalink to [post_title]" href="[link]">[post_title]</a></h2> <div class="entry-meta">[meta]</div> <div class="entry-content">[post_excerpt] [more]</div> </div>
This is not a 100% match, as we do not have thumbnail, tag and categories for the post etc. But, it match most of it. The post meta section (<div class=”entry-meta”>[meta]</div>) can be customied more deeply, we just used it as we already have similar thing by the plugin.
