AnsPress_Category::category_page()

Description #

Category page layout.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: addons/free/category.php

	public static function category_page() {
		$question_args = array(
			'tax_query' => array(
				array(
					'taxonomy' => 'question_category',
					'field' => 'id',
					'terms' => array( get_queried_object_id() ),
				),
			),
		);

		$question_category = get_queried_object();

		if ( $question_category ) {
			anspress()->questions = ap_get_questions( $question_args );

			/**
			 * This action can be used to show custom message before category page.
			 *
			 * @param object $question_category Current question category.
			 * @since 1.4.2
			 */
			do_action( 'ap_before_category_page', $question_category );

			include( ap_get_theme_location( 'addons/category/single-category.php' ) );
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment