[wordpress插件] Custom Pagination自定义分页

wordpress 插件 文章 2020-04-08 22:50 1457 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

With the Custom Pagination plugin, a user may customize the look of a post’s next and previous links using the HTML editor.

使用“自定义分页”插件,用户可以使用HTML编辑器自定义帖子的下一个和上一个链接的外观。

It is built by WebIT.ca (Dimitry Zolotaryov) and funded by

它由 WebIT.ca(Dimitry Zolotaryov)构建,并由

rel="nofollow">DateDaily.com: an online dating and relationship blog.

rel =“ nofollow”> DateDaily.com :在线约会和关系博客。

The link is created by selecting the text label within a post’s body and clicking the link icon.

通过选择帖子正文中的文本标签并单击链接图标来创建链接。

In the Link URL field, the following values will produce a link to another page:

在“链接URL”字段中,以下值将产生到另一个页面的链接:

    • page:next links to the next page
    • page:next 链接到下一页

    • page:prev or page:previous links to the previous page
    • page:prev page:previous 链接到上一页

    • page:first links to the first page of the post
    • page:first 链接到帖子的首页

    • page:last links to the last page of a post
    • page:last 链接到帖子的最后一页

    • page:n links to the nth page of a post (e.g. page:2 for the second page)
    • page:n 链接到帖子的第n页(例如第二页的page:2)

    If link is directing to a page that does not exist — for instance page:next on the last page –, the link and the link text do not appear.

    如果链接指向不存在的页面(例如,最后一页上的 page:next ),则该链接和链接文本不会出现。

    All links processed by Custom Pagination will have the added class name ‘page’.

    通过“自定义分页”处理的所有链接都将具有添加的类名“页面”。

    If you wish to style such links, in your CSS, add the line:

    如果您希望为此类链接设置样式,请在CSS中添加以下行:

    a.page { /* page style goes here */ }

      a.page {/ *页面样式在此处* /}

    For more information, visit the Custom Pagination plugin homepage

    有关更多信息,请访问自定义分页插件首页

    >.

    >。

安装步骤

    1. Copy or upload the custom-pagination directory into your /wp-content/plugins/ directory
    2. custom-pagination 目录复制或上传到您的 / wp-content / plugins / 目录

    3. If you downloaded a zipped copy (i.e. custom-pagination.zip), use the ‘Plugins’ > ‘Add New’ section of WordPress to upload it
    4. 如果您下载了压缩副本(即 custom-pagination.zip ),请使用WordPress的“插件”>“添加新内容”部分上传

    5. Activate the plugin through the ‘Plugins’ menu in WordPress
    6. 通过WordPress中的“插件”菜单激活插件

    Done.

    完成。

    Actually, if you wish to use WordPress pagination when there is no Custom Pagination on a page, you may use the following PHP code:

    实际上,如果您希望在页面上没有自定义分页时使用WordPress分页,则可以使用以下PHP代码:

    // inside single.php

      //在single.php中

    // displays the standard pagination when no custom pagination link is found

    //未找到自定义分页链接时显示标准分页

    if ( ! cp_link_found() )    

    如果(!cp_link_found())    

    wp_link_pages(array('next_or_number' => 'next', 'nextpagelink'=>'Next page »', 'previouspagelink'=>'« Previous page'));

    wp_link_pages(array('next_or_number'=>'next','nextpagelink'=>'下一页»','previouspagelink'=>'«前一页')));

下载地址
https://downloads.wordpress.org/plugin/custom-pagination.zip
-EOF-

AI助手支持GPT4.0