下面是在函数中处理分页的代码部分。php:
// Pagination Setup
$current = (get_query_var(\'paged\')) ? get_query_var( \'paged\' ) : 1;
$per_page = 3;
$offset = ($current-1) * $per_page;
$big = 999999999;
$total = sizeof($attachments);
$total_pages = round($total/$per_page);
if( $total_pages < ( $total/$per_page ) ){
$total_pages = $total_pages+1;
}
// Pagination output
$output .= paginate_links( array(
\'base\' => str_replace($big,\'%#%\',esc_url(get_pagenum_link($big))),
\'format\' => \'?paged=%#%\',
\'current\' => $current,
\'total\' => $total_pages,
\'prev_text\' => __(\'«\'),
\'next_text\' => __(\'»\')
) );
页面如下:https://www.motorizm.net/bugatti-type-41-royale/
The issue:
代码成功地将图像分成三个组,为这些组创建页面,创建页码,并创建指向页面的链接。But when I click on any pagination link, I do not go anywhere.虽然当页面(https://www.motorizm.net/bugatti-type-41-royale/ ) “已”;状态:草稿“;,分页链接按预期工作。
有什么想法吗?