Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Hi, I'm having issues with getting archive blog posts to display. The Archive links appear OK in the sidebar and have the date appended to the url e.g. ?d=201602...but when I click on the links the standard blog layout is displayed with the latest blog items first. This is the URL: http://ringwoodwebdesign.com/wsx/dogs/blog.php

This is the code for displaying the links:
Code: Select all
<div class="span2 sidebar">      
         <h2>Archive</h2>
            
         <ul class="newsside">
            <cms:archives masterpage='blog.php'>
            <li><a href="<cms:show k_archive_link />><cms:date k_archive_date format='F Y' /></a></li>
            </cms:archives>
         </ul>
</div>


I've tried to follow the instructions carefully but maybe I missed something...

Thanks
Hi @DM777,

Your code doing the actual listing of the posts on the template is likely to be some variation of the following -
Code: Select all
<cms:pages masterpage='blog.php' paginate='1' limit='10'>
   ...
</cms:pages>

To make the code above 'archive aware' (i.e list only posts of the specified archive period), you need to add the following parameters to it -
<cms:pages masterpage='blog.php' start_on=k_archive_date stop_before=k_next_archive_date paginate='1' limit='10'>

If you need more info on the subject, please see http://docs.couchcms.com/concepts/listing-pages.html

Hope it helps.
2 posts Page 1 of 1