Ejemplo n.º 1
0
            ?>
				<?php 
        }
        ?>
			<?php 
    }
    ?>
			<?php 
    wp_reset_postdata();
    ?>
		<?php 
    do_action('dwqa_after_answers_list');
    ?>
	</div>
	<?php 
}
?>
	<?php 
if (dwqa_current_user_can('post_answer') && !dwqa_is_closed(get_the_ID())) {
    ?>
		<?php 
    dwqa_load_template('answer', 'submit-form');
    ?>
	<?php 
}
?>
	<?php 
do_action('dwqa_after_answers');
?>
</div>
Ejemplo n.º 2
0
    }
}
wp_reset_query();
//End answer listing
// Answer Page Naving
if ($answers->max_num_pages > 1) {
    $question_url = get_permalink($question_id);
    echo '<h3 class="dwqa-answers-page-navigation-head">' . sprintf(__('Answer page %d', 'dwqa'), $ans_cur_page) . '</h3>';
    echo '<ul class="dwqa-answers-page-navigation">';
    for ($i = 1; $i <= $answers->max_num_pages; $i++) {
        echo '<li class="' . ($ans_cur_page == $i ? 'active' : '') . '"><a href="' . esc_url(add_query_arg('ans-page', $i, $question_url)) . '">' . $i . '</a></li>';
    }
    echo '</ul>';
}
//Create answer form
if (dwqa_is_closed($question_id)) {
    echo '<p class="alert">' . __('This question is now closed', 'dwqa') . '</p>';
    return false;
}
if (dwqa_current_user_can('post_answer')) {
    dwqa_load_template('answer', 'submit-form');
} else {
    ?>
	<?php 
    if (is_user_logged_in()) {
        ?>
		<div class="alert"><?php 
        _e('You do not have permission to submit answer.', 'dwqa');
        ?>
</div>
	<?php 
Ejemplo n.º 3
0
    ?>
</span>
	</div>
	<?php 
}
?>

	<?php 
if (have_comments()) {
    ?>
	<ol class="dwqa-comment-list">
	<?php 
    wp_list_comments(array('style' => 'ol', 'callback' => 'dwqa_question_comment_callback'));
    ?>
	</ol>
	<?php 
}
?>

	<?php 
if (!dwqa_is_closed(get_the_ID()) && dwqa_current_user_can('post_comment')) {
    ?>
		<?php 
    global $current_user;
    $args = array('comment_field' => (is_user_logged_in() ? get_avatar($current_user->ID, 32) : '') . '<textarea id="comment" name="comment" aria-required="true" placeholder="' . __('Write a reply...', 'dwqa') . '"></textarea>', 'comment_notes_before' => '', 'logged_in_as' => '', 'comment_notes_after' => '', 'id_form' => 'comment_form_' . get_the_ID());
    ?>
		<?php 
    dwqa_comment_form($args);
    ?>
	<?php 
}