Hello all,
I have been trying to get view_count tag working for me since few weeks now for a website which has a section called trending. I followed almost every other post on this forum, tried various suggestion however I just cant get it to start incrementing the view count. Have enabled tracking in preferences. Any help will be much appreciated.
My code :
{exp:channel:entries url_title="<?php echo $url;?>" limit="1" track_views="one"}
<div class="fixedTitleWrap" >
<div class="article-heading">{title}</div>
{exp:trunchtml chars="150" inline="..."}{story}{/exp:trunchtml}
<div class="clear"></div>
</div>
{/exp:channel:entries}
<div class="paginationWrap">
<?php if($previous_id!=''){ ?>
{exp:channel:entries entry_id="<?php echo $previous_id?>" channel="not correspondents"}
<div class="lhs">
<span class="arrow prev"></span>
<span class="articleTitle prevTitle">{title}</span>
<span class="clear"></span>
</a>
</div>
{/exp:channel:entries}
<?php } ?>
<?php if($next_id!=''){ ?>
{exp:channel:entries entry_id="<?php echo $next_id?>" channel="not correspondents"}
<div class="rhs">
<span class="arrow next"></span>
<span class="articleTitle nextTitle">{title}</span>
<span class="clear"></span>
</a>
</div>
{/exp:channel:entries}
<?php } ?>
</div>Retrieval code :
{exp:channel:entries orderby="view_count_one" dynamic="no" sort="desc" search:gc_city="=Mumbai" }
<div class="content">
<div class="heading">{title}</div>
<div class="view_count">This entry was viewed {view_count_one} times</div>
</div>
{/exp:channel:entries}The view_count_one reflected in any of the posts is 0.