I'm using the EXP:QUERY tag to get the count of a channel. And I am basically trying to use this for page pagination, and its a custom pagination because of the type of template I'm building.
And I am trying to use the count I receive and use some math to get a page count based on the number of results I have on each page. 5 results per page. So below is what I have.
<?php $foo = {count} / 5; ?>
{if segment_2 <= $foo}
<li><a class="button next" href="<? $week_count = {segment_2} + 1; echo "/page/" . $week_count; ?>">Next</a></li>
{/if}
I am trying to use the PHP variable $foo within the expressionengine if statement but I can't, what is a better way to do this? Without having to write out it all in PHP.