• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Outputting number of replies/posts & likes in the first post of every thread

Ray

Active member
#1
I would like to display the number of replies/posts each thread has along with the number of LIKES the first post has, see screenshot:

sshot.png

Thanks in advance :)
 

Jake Bunce

XenForo moderator
Staff member
#3
Admin CP -> Appearance -> Templates -> thread_view

Add this code:

Code:
<div>
	<span class="highlight">Replies</span>: {$thread.reply_count} <span class="highlight" style="margin-left: 20px;">Likes</span>: {$thread.first_post_likes}
</div>
Like so:

Code:
<xen:container var="$head.canonical">
	<link rel="canonical" href="{xen:link 'canonical:threads', $thread, 'page={$page}'}" /></xen:container>
<xen:container var="$head.description">
	<meta name="description" content="{xen:helper snippet, $firstPost.message, 155}" /></xen:container>
<xen:container var="$head.openGraph"><xen:include template="open_graph_meta">
		<xen:set var="$url">{xen:link 'canonical:threads', $thread}</xen:set>
		<xen:set var="$title">{$thread.title}</xen:set>
		<xen:set var="$avatar">{xen:helper avatar, $thread, m, 0, 1}</xen:set>
	</xen:include></xen:container>

<div>
	<span class="highlight">Replies</span>: {$thread.reply_count} <span class="highlight" style="margin-left: 20px;">Likes</span>: {$thread.first_post_likes}
</div>

<xen:if is="{$canReply}">
	<xen:comment><xen:topctrl>
		<a href="{xen:link 'threads/reply', $thread}" class="callToAction"><span>{xen:phrase reply_to_thread}</span></a>
	</xen:topctrl></xen:comment>
</xen:if>
The result:

Screen shot 2011-07-05 at 9.59.12 AM.png