by
KK » Thu Feb 11, 2016 2:23 am
@srewebso, I'll assume that you did try the solutions offered in this thread but somehow couldn't get them to work with your layout.
So, here is a fully working version of your code using the first solution (though all the others will do the job equally well) -
Stripped down, your code is effectively this -
- Code: Select all
<cms:pages masterpage='blog.php' paginate='1' limit='6' >
<div class="hentry-row">
<article class="loadmore-item col-md-4 col-sm-6 hentry">
....
</article>
</div>
<cms:if k_paginated_bottom >
<div class="loadmore-action">
<a href="<cms:show k_paginate_link_next />" class="btn-loadmore">Load More</a>
</div>
</cms:if>
</cms:pages>
My solution given early in this thread used 'open' and 'close' as placeholders for markup that opens/closes the row -
- Code: Select all
<cms:set my_max_columns='3' 'global' />
<cms:pages masterpage='blog.php'>
<cms:if k_paginated_top >
<h5>open</h5>
</cms:if>
<h3><cms:show k_page_title /></h3>
<cms:if k_paginated_bottom || "<cms:not "<cms:mod k_count my_max_columns />" />" >
<h5>close</h5>
<cms:if "<cms:not k_paginated_bottom />" >
<h5>open</h5>
</cms:if>
</cms:if>
</cms:pages>
Replacing the 'open' and 'close' with your markup would yield -
- Code: Select all
<cms:set my_max_columns='3' 'global' />
<cms:pages masterpage='blog.php' paginate='1' limit='6'>
<cms:if k_paginated_top >
<!-- open row -->
<div class="hentry-row">
</cms:if>
<!-- show post -->
<article class="loadmore-item col-md-4 col-sm-6 hentry">
<h2><cms:show k_page_title /></h2>
..
</article>
<cms:if k_paginated_bottom || "<cms:not "<cms:mod k_count my_max_columns />" />" >
<!-- close existing row -->
</div>
<cms:if k_paginated_bottom >
<!-- show paginator -->
<div class="loadmore-action">
<a href="<cms:show k_paginate_link_next />" class="btn-loadmore">Load More</a>
</div>
<cms:else />
<!-- open next row -->
<div class="hentry-row">
</cms:if>
</cms:if>
</cms:pages>
I've added comments in the code above so that you'd find it easier to understand.
Hope it helps.