Created
February 11, 2018 04:15
-
-
Save rahularyan/abb7df3b44e21fe0c9624fc8dbec457a to your computer and use it in GitHub Desktop.
Display single question category of AnsPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$category_id = 1; // Replace it. | |
$question_args = array( | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'question_category', | |
'field' => 'id', | |
'terms' => array( $category_id ), | |
), | |
), | |
); | |
$question_category = get_term( $category_id, 'question_category' ); | |
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' ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment