您需要使用在源中定义的相邻图像链接过滤器adjacent_image_link()
function.
示例:
add_filter( "next_image_link", "cyb_next_image_link", 10, 4 );
function cyb_next_image_link( $output, $attachment_id, $size, $text ) {
if( $output == \'\' ) {
return \'<div class="next-image"><span>NEXT</span> <i class="fa fa-angle-right"></i></div>\';
}
return $output;
}
add_filter( "previous_image_link", "cyb_previous_image_link", 10, 4 );
function cyb_previous_image_link( $output, $attachment_id, $size, $text ) {
if( $output == \'\' ) {
return \'<div class="previous-image"><span>PREV</span> <i class="fa fa-angle-right"></i></div>\';
}
return $output;
}