Custom Pagination, using global variable value inside a function
-
hi all,
I need help with custom pagination function. I am trying to use max page number value from outside a function as a global variable. Check the code below. Have no idea why I can not make it to work. I have tried lots of stuff.so I am trying to pass the value of $number_of_pages from outside the function to $max, which is inside the function.
/*-----------------------------------------------------------------------------------*/ $number_of_pages = $query->max_num_pages; //echo $number_of_pages; /*-----------------------------------------------------------------------------------*/ /* Numeric Pagination */ /*-----------------------------------------------------------------------------------*/ function ct_numeric_pagination_boot() { /** Add current page to the array */ global $number_of_pages; //$paged = get_query_var('page') ? absint( get_query_var('page') ) : 1; $paged = $query->query['paged']; $max = $number_of_pages; .......
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom Pagination, using global variable value inside a function’ is closed to new replies.