Categories::categories_page()
Description #
Categories page layout
Source #
File: addons/categories/categories.php
public function categories_page() { global $question_categories, $ap_max_num_pages, $ap_per_page; $paged = max( 1, get_query_var( 'paged' ) ); $per_page = ap_opt( 'categories_per_page' ); $total_terms = wp_count_terms( array( 'taxonomy' => 'question_category', 'hide_empty' => false, 'parent' => 0, ) ); $offset = $per_page * ( $paged - 1 ); $ap_max_num_pages = ceil( $total_terms / $per_page ); $order = ap_opt( 'categories_page_order' ) === 'ASC' ? 'ASC' : 'DESC'; $cat_args = array( 'parent' => 0, 'number' => $per_page, 'offset' => $offset, 'hide_empty' => false, 'orderby' => ap_opt( 'categories_page_orderby' ), 'order' => $order, ); /** * Filter applied before getting categories. * * @param array $cat_args `get_terms` arguments. * @since 1.0 */ $cat_args = apply_filters( 'ap_categories_shortcode_args', $cat_args ); $cat_args['taxonomy'] = 'question_category'; $question_categories = get_terms( $cat_args ); include ap_get_theme_location( 'addons/category/categories.php' ); }
Expand full source code Collapse full source code View on GitHub: addons/categories/categories.php:130
Add your comment