
wordpress有个在文章内插入分页符的功能<!–nextpage–>
唯一的缺点就是使用后,文章下方显示的是全部分页页码,要增加“上一页”和“下一页”这个功能就要手工进行修改了。
在后台控制板中,点击左侧导航的“外观”/“编辑”,在右侧找到“文章页面”进行编辑
找到代码中的“wp_link_pages”,用下面的3行代码进行替换即可
<?php wp_link_pages(array('before' => '<p><strong>页码: </strong> ', 'after' => '','next_or_number'=>'next', 'nextpagelink'=>'')); ?> <?php wp_link_pages(array('before' => '', 'after' => '','next_or_number' => 'number')); ?> <?php wp_link_pages(array('before' => '', 'after' => '</p>','next_or_number'=>'next', 'previouspagelink' => '')); ?>
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
These cookies are needed for adding comments on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com
You can find more information in our Cookie Policy and Cookie Policy.