コード例 #1
0
    the_content();
    ?>
</div>
			<?php 
    the_question_category(__('Category:', QA_TEXTDOMAIN) . ' <span class="question-category">', '', '</span>');
    ?>
			<?php 
    the_question_tags(__('Tags:', QA_TEXTDOMAIN) . ' <span class="question-tags">', ' ', '</span>');
    ?>
			

			<?php 
    the_qa_action_links(get_the_ID());
    ?>
			<?php 
    the_qa_author_box(get_the_ID());
    ?>
			
		</div>
	</div>
</div>

<?php 
    if (is_question_answered()) {
        ?>
<div id="answer-list">
	<h2><?php 
        the_answer_count();
        ?>
</h2>
	<?php 
コード例 #2
0
function do_qa_single()
{
    ?>
  <div class="post_box top">
    <div class="format_text">
      <?php 
    //get_header( 'question' );
    ?>

      <div id="qa-page-wrapper">
        <div id="qa_banner"></div>
        <?php 
    the_qa_menu();
    ?>

        <?php 
    the_post();
    ?>

        <?php 
    if ($user_ID == 0 || current_user_can('read_questions', 0)) {
        ?>
        <div id="single-question">
          <h1><?php 
        the_title();
        ?>
</h1>
          <div id="single-question-container">
            <?php 
        the_question_voting();
        ?>
            <div id="question-body">
              <div id="question-content"><?php 
        the_content();
        ?>
</div>
              <?php 
        the_question_category(__('Category:', QA_TEXTDOMAIN) . ' <span class="question-category">', '', '</span>');
        ?>
              <?php 
        the_question_tags(__('Tags:', QA_TEXTDOMAIN) . ' <span class="question-tags">', ' ', '</span>');
        ?>
              <span id="qa-lastaction"><?php 
        _e('asked', QA_TEXTDOMAIN);
        ?>
 <?php 
        the_qa_time(get_the_ID());
        ?>
</span>

              <div class="question-meta">
                <?php 
        the_qa_action_links(get_the_ID());
        ?>
                <?php 
        the_qa_author_box(get_the_ID());
        ?>
              </div>
            </div>
          </div>
        </div>
        <?php 
    }
    ?>

        <?php 
    if (($user_ID == 0 || current_user_can('read_answers', 0)) && is_question_answered()) {
        ?>
        <div id="answer-list">
          <h2><?php 
        the_answer_count();
        ?>
</h2>
          <?php 
        the_answer_list();
        ?>
        </div>
        <?php 
    }
    ?>
        <?php 
    if ($user_ID == 0 || current_user_can('publish_answers', 0)) {
        ?>
        <div id="edit-answer">
          <h2><?php 
        _e('Your Answer', QA_TEXTDOMAIN);
        ?>
</h2>
          <?php 
        the_answer_form();
        ?>
        </div>
        <?php 
    }
    ?>

        <p><?php 
    the_question_subscription();
    ?>
</p>

      </div><!--#qa-page-wrapper-->

      <?php 
    //get_sidebar( 'question' );
    ?>

      <?php 
    //get_footer( 'question' );
    ?>
    </div>
  </div>

  <?php 
}
コード例 #3
0
ファイル: template-tags.php プロジェクト: rgrp/wordpress-qa
function the_answer_list()
{
    $question_id = get_the_ID();
    #	if ( !current_user_can( 'read_answers', $question_id ) )
    #		return;
    $accepted_answer = get_post_meta($question_id, '_accepted_answer', true);
    $answers = new WP_Query(array('post_type' => 'answer', 'post_parent' => $question_id, 'post__not_in' => array($accepted_answer), 'orderby' => 'qa_score', 'posts_per_page' => QA_ANSWERS_PER_PAGE, 'paged' => get_query_var('paged')));
    if ($accepted_answer && !get_query_var('paged')) {
        array_unshift($answers->posts, get_post($accepted_answer));
    }
    the_qa_pagination($answers);
    foreach ($answers->posts as $answer) {
        setup_postdata($answer);
        ?>
	<div id="answer-<?php 
        echo $answer->ID;
        ?>
" class="answer">
		<?php 
        the_answer_voting($answer->ID);
        ?>
		<div class="answer-body">
			<?php 
        echo get_the_content();
        ?>
			<?php 
        the_qa_author_box($answer->ID);
        ?>
			<?php 
        the_qa_action_links($answer->ID);
        ?>
		</div>
	</div>
<?php 
    }
    the_qa_pagination($answers);
    wp_reset_postdata();
}
コード例 #4
0
function do_qa_archive()
{
    ?>
  <div class="post_box top">
    <div class="format_text">
      <?php 
    //get_header( 'question' );
    ?>

      <div id="qa-page-wrapper">
        <div id="qa_banner"></div>
        <?php 
    the_qa_error_notice();
    ?>
        <?php 
    the_qa_menu();
    ?>

        <?php 
    if (!have_posts()) {
        ?>

        <p><?php 
        $question_ptype = get_post_type_object('question');
        echo $question_ptype->labels->not_found;
        ?>
</p>

        <?php 
    } else {
        ?>

        <div id="question-list">
          <?php 
        while (have_posts()) {
            the_post();
            ?>
          <div class="question">
            <div class="question-stats">
              <?php 
            the_question_score();
            ?>
              <?php 
            the_question_status();
            ?>
            </div>
            <div class="question-summary">
              <h3><?php 
            the_question_link();
            ?>
</h3>
              <div class="question-excerpt">
                <?php 
            the_excerpt();
            ?>
              </div>
              <?php 
            the_question_tags('<div class="question-tags">', ' ', '</div>');
            ?>
              <div class="question-started">
                <?php 
            the_qa_time(get_the_ID());
            ?>
                <?php 
            //the_qa_user_link( $post->post_author );
            ?>
              </div>
              <?php 
            the_qa_author_box(get_the_ID());
            ?>
            </div>
          </div>
          <?php 
        }
        ?>
        </div><!--#question-list-->

        <?php 
        the_qa_pagination();
        ?>

        <?php 
    }
    ?>

      </div><!--#qa-page-wrapper-->

      <?php 
    //get_sidebar( 'question' );
    ?>

      <?php 
    //get_footer( 'question' );
    ?>
    </div>
  </div>
  <?php 
}