How to create function from code?
You need to pass it at least 2 parameters, or it won’t know what to look for: <?php function custom_pagination($cat_id, $catnum) { // Start of Pagination $total_childs_query = get_categories( array( ‘parent’ => $cat_id, ‘hide_empty’ => ‘0’ )); $total_terms = count( $total_childs_query ); $pages = ceil($total_terms/$catnum); $base_url = get_term_link( $cat_id, get_query_var( ‘taxonomy’ ) ); // if … Read more