本文整理汇总了PHP中ap_have_questions函数的典型用法代码示例。如果您正苦于以下问题:PHP ap_have_questions函数的具体用法?PHP ap_have_questions怎么用?PHP ap_have_questions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ap_have_questions函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: question_page
/**
* Output single question page
* @return void
*/
public function question_page()
{
global $questions;
ap_get_question(get_question_id());
if (ap_have_questions()) {
while (anspress()->questions->have_posts()) {
anspress()->questions->the_post();
global $post;
setup_postdata($post);
}
include ap_get_theme_location('question.php');
wp_reset_postdata();
} else {
include ap_get_theme_location('not-found.php');
}
}
示例2: question_page
/**
* Output single question page
* @return void
*/
public function question_page()
{
global $questions;
$questions = ap_get_question(get_question_id());
if (ap_have_questions()) {
/**
* Set current question as global post
* @since 2.3.3
*/
while (ap_questions()) {
ap_the_question();
global $post;
setup_postdata($post);
include ap_get_theme_location('question.php');
}
wp_reset_postdata();
} else {
include ap_get_theme_location('not-found.php');
}
}
示例3: while
<div class="ap-questions-widget clearfix">
<?php
if (ap_have_questions()) {
/* Start the Loop */
while (ap_questions()) {
ap_the_question();
$ans_count = ap_question_get_the_answer_count();
$net_vote = ap_question_get_the_net_vote();
?>
<div class="ap-question-item">
<a class="ap-question-title"href="<?php
ap_question_the_permalink();
?>
"><?php
the_title();
?>
</a>
<span class="ap-ans-count"><?php
printf(_n('1 answer', '%d answers', $ans_count, 'ap'), $ans_count);
?>
</span>
<span class="ap-vote-count"> | <?php
printf(_n('1 vote', '%d votes', $net_vote, 'ap'), $net_vote);
?>
</span>
</div>
<?php
}
} else {
_e('No questions found.', 'ap');
}
示例4: question_page
/**
* Output single question page
* @return void
*/
public function question_page()
{
// Set Header as 404 if question id is not set.
if (false === get_question_id()) {
$this->set_404();
return;
}
global $questions;
$questions = ap_get_question(get_question_id());
if (ap_have_questions()) {
/**
* Set current question as global post
* @since 2.3.3
*/
while (ap_questions()) {
ap_the_question();
global $post;
setup_postdata($post);
}
include ap_get_theme_location('question.php');
wp_reset_postdata();
} else {
$this->set_404();
}
}