Pagination offset and paged variables
-
Can anyone explain how the “paged” and “offset” variables work in relation to the following block of code?
<?php $catpage = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; $catnum = 3; $offset = ($catnum * $catpage) - 3; $cat = get_category( get_query_var( 'cat' ) ); $cat_id = $cat->cat_ID; $child_categories=get_categories( array( 'parent' => $cat_id, 'orderby' => 'id', 'order' => 'DESC', 'hide_empty' => '0', 'number' => $catnum, 'offset' => $offset, 'paged' => $catpage // Uncomment the below line if you want empty category to appear on the list. // 'hide_empty' => 0 ) ); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Pagination offset and paged variables’ is closed to new replies.