feat: add article pagination (#38)

pull/230/head
Seaton Jiang 2020-03-14 10:18:22 +08:00
parent 3c992204bb
commit 621b468815
4 changed files with 82 additions and 2 deletions

View File

@ -417,6 +417,31 @@ button:focus {
color: #444;
}
.k-main .details .article .content .paginations {
padding-top: 20px;
width: 100%;
font-size: 14px;
}
.k-main .details .article .content .paginations a {
margin: 0 3px;
}
.k-main .details .article .content .paginations a span {
padding: 7px 12px;
border: solid 1px #00a2ff;
background-color: #f0f8ff;
color: #00a2ff;
}
.k-main .details .article .content .paginations .current span,.k-main .details .article .content .paginations a span:hover {
padding: 7px 12px;
border: solid 1px #00a2ff;
background: #00a2ff;
color: #ffffff;
font-weight: 400;
}
/*--------------------------------------------------------------
5.
--------------------------------------------------------------*/

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,35 @@ get_header(); ?>
<h1 class="title m-0"><?php the_title(); ?></h1>
</div>
<div class="content">
<?php the_content(); ?>
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="paginations text-center">',
'after' => '',
'next_or_number' => 'next',
'previouspagelink' => __('<span>上一页</span>', 'kratos'),
'nextpagelink' => ''
)
);
wp_link_pages(
array(
'before' => '',
'after' => '',
'next_or_number' => 'number',
'link_before' =>'<span>',
'link_after'=>'</span>'
)
);
wp_link_pages(
array(
'before' => '',
'after' => '</div>',
'next_or_number' => 'next',
'previouspagelink' => '',
'nextpagelink' => __('<span>下一页</span>', 'kratos')
)
); ?>
</div>
</div>
<?php endif; ?>

View File

@ -49,6 +49,33 @@ get_header(); ?>
}
}
the_content();
wp_link_pages(
array(
'before' => '<div class="paginations text-center">',
'after' => '',
'next_or_number' => 'next',
'previouspagelink' => __('<span>上一页</span>', 'kratos'),
'nextpagelink' => ''
)
);
wp_link_pages(
array(
'before' => '',
'after' => '',
'next_or_number' => 'number',
'link_before' =>'<span>',
'link_after'=>'</span>'
)
);
wp_link_pages(
array(
'before' => '',
'after' => '</div>',
'next_or_number' => 'next',
'previouspagelink' => '',
'nextpagelink' => __('<span>下一页</span>', 'kratos')
)
);
if(kratos_option('s_singledown',false)){
if(kratos_option('s_singledown_links')){
echo '<a href="'. kratos_option('s_singledown_links') .'" target="_blank" rel="noreferrer">';