پرسش و پاسخ

Home / پرسش و پاسخ

[insert_php]
define(“DEFAULT_COMMENTS_PER_PAGE”,15);

$page = (get_query_var(“page”)) ? get_query_var(“page”) : 1;;

$limit = DEFAULT_COMMENTS_PER_PAGE;

$offset = ($page * $limit) – $limit;

$param = array(

“status”=>”approve”,

“offset”=>$offset,

“number”=>$limit,

);
$total_comments = get_comments(array(“orderby” => “post_date” ,

“order” => “DESC”,

“status” => “approve”));

$pages = ceil(count($total_comments)/DEFAULT_COMMENTS_PER_PAGE);
$comments = get_comments($param );

//Display the list of comments
wp_list_comments(array(
“per_page” => 10, //Allow comment pagination
“reverse_top_level” => false //Show the latest comments at the top of the list
), $comments);

//echo “

“;

$paginate_links = paginate_links($args1 );

if ($paginate_links) {
echo “

“;
}

echo “

ارسال پرسش

“;

comment_form();

[/insert_php]

Comments are closed.