当前位置: 首页>>代码示例>>PHP>>正文


PHP ap_questions函数代码示例

本文整理汇总了PHP中ap_questions函数的典型用法代码示例。如果您正苦于以下问题:PHP ap_questions函数的具体用法?PHP ap_questions怎么用?PHP ap_questions使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ap_questions函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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');
     }
 }
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:24,代码来源:common-pages.php

示例2: 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');
}
开发者ID:Byrlyne,项目名称:anspress,代码行数:31,代码来源:widget-questions.php

示例3: 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();
     }
 }
开发者ID:Byrlyne,项目名称:anspress,代码行数:29,代码来源:common-pages.php


注:本文中的ap_questions函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。