All options can be set in an options page, the pagination container can be injected or appended to the existing DOM.
If you are unsure about the HTML structure of your Website, you can do the following (in Firefox):
- Right click the spot where you wish the pagination to appear and choose `Inspect Element (Q)` from the menu list
- 右键单击希望出现分页的位置,然后从菜单列表中选择“检查元素(Q)” li>
- Copy the id of the container, i.e. #wrapper.someclass
- 复制容器的ID,即#wrapper.someclass li>
- To append or prepend the pagination to this container, paste it’s id into the appropriate field of the Placement section under `Settings->3pagination`
- 要将分页附加或添加到此容器之前,请将其ID粘贴到“设置”->“ 3pagination”下的“放置”部分的相应字段中。 li>
- Choose on which pages (archives, search etc.) the pagination should appear.
- 选择应在哪些页面上显示分页(存档,搜索等)。
Done!
完成! li>
ol>
How to use – old school
使用方法–老学校 h4>
You can, if you want (or to have your website degrade gracefully), call the class methods in your theme files.
如果需要(或使网站正常降级),可以在主题文件中调用类方法。 p>
draw() : Display the pagination
draw():显示分页
draw ( $pretty = TRUE, $max_num_pages = FALSE, $labels = TRUE, $css = ‘classic’, $wp_query = FALSE )
绘制($ pretty = TRUE,$ max_num_pages = FALSE,$ labels = TRUE,$ css ='classic',$ wp_query = FALSE) p>
- $pretty (optional) |
- $ pretty(可选)|
Are you using pretty permalinks?
您是否在使用漂亮的永久链接? li>
- $max_num_pages (optional) |
- $ max_num_pages(可选)|
Limit to a maximum number of pages
限制为最大页面数 li>
- $labels (optional) |
- $ labels(可选)|
Display or not the navigation arrows
显示或不显示导航箭头 li>
- $css (optional) |
- $ css(可选)|
CSS class name that will be appended to the main div container
将添加到主div容器的CSS类名称 li>
- $wp_query (optional) |
- $ wp_query(可选)|
custom WP query object
自定义WP查询对象
li>
ul>
get() : Return the pagination as a HTML string
get():将分页作为HTML字符串返回
get ( $pretty = TRUE, $num_items = FALSE, $per_page = FALSE, $labels = TRUE, $css = ‘classic’, $wp_query = FALSE )
get($ pretty = TRUE,$ num_items = FALSE,$ per_page = FALSE,$ labels = TRUE,$ css ='classic,$ wp_query = FALSE) p>
Example usages
用法示例 h4>
threepagination::draw ( TRUE, FALSE, FALSE, 'my_custom_class', FALSE ) threepagination :: draw(TRUE,FALSE,FALSE,'my_custom_class',FALSE)
code> pre>
Displays the pagination on a website that uses pretty urls, takes the standard page count, hides the navigation arrows, attributes a CSS class ‘my_custom_class’ to the pagination container and uses the global query object.
在使用漂亮网址的网站上显示分页,获取标准页面数,隐藏导航箭头,将CSS类“ my_custom_class”分配给分页容器并使用全局查询对象。 p>
$string = threepagination::get () $ string = threepagination :: get()
code> pre>
Save the pagination in the $string
var.
将分页保存在 $ string code>变量中。 p>