Hello,
I'm using a template page as a frontpage. In that template page I want to loop items from a table containing a lot of items, too many to be managed by wp posts so I decided to put into a separate table. I want to be able to paginate with /page/x like WP does.
I've setup frontpage succesfully through Settings>Reading and I can see the first 5 items, but if I navigate to /page/2, I get 404.
The code on top of the template page is the classic pagination code:
global $wpdb;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$offset = ($paged-1)*5;
$rows = $wpdb->get_results("
select *
from {$wpdb->prefix}companies
limit $offset,5
");
How can I get pagination working on a custom frontpage that is not the classic post loop?
Thank you.