PHPackages                             sectsect/wp-split-single-page - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sectsect/wp-split-single-page

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

sectsect/wp-split-single-page
=============================

Supply some functions and Pagination for split single page for each array of custom field without &lt;!--nextpage--&gt; on your template.

v1.4.0(7y ago)112MITPHPPHP &gt;=5.3

Since Jan 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/sectsect/wp-split-single-page)[ Packagist](https://packagist.org/packages/sectsect/wp-split-single-page)[ RSS](/packages/sectsect-wp-split-single-page/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)DependenciesVersions (11)Used By (0)

[![](https://camo.githubusercontent.com/b8a22d292780c631360a84efd912e57855d5395021965174bffa6f3b255dd62f/68747470733a2f2f6769746875622d736563742e73332d61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f6c6f676f2e737667)](https://camo.githubusercontent.com/b8a22d292780c631360a84efd912e57855d5395021965174bffa6f3b255dd62f/68747470733a2f2f6769746875622d736563742e73332d61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f6c6f676f2e737667) WP Split Single Page
======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#-wp-split-single-page)

[![Build Status](https://camo.githubusercontent.com/7fbe935dc7d450422973308a2379d94f4f9715db1c70baf50d8320498e8edd94/68747470733a2f2f7472617669732d63692e6f72672f73656374736563742f77702d73706c69742d73696e676c652d706167652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sectsect/wp-split-single-page) [![PHP-Eye](https://camo.githubusercontent.com/7ad3120de675009887ec7e10f9a74ebb14ea276264e643411642d6aa5855931b/68747470733a2f2f7068702d6579652e636f6d2f62616467652f73656374736563742f77702d73706c69742d73696e676c652d706167652f7465737465642e7376673f7374796c653d666c6174)](https://php-eye.com/package/sectsect/wp-split-single-page) [![Latest Stable Version](https://camo.githubusercontent.com/bacb531368ca87f21dbb909bb22d232841ed52e342c4c0338fa7ce5b054b7750/68747470733a2f2f706f7365722e707567782e6f72672f73656374736563742f77702d73706c69742d73696e676c652d706167652f762f737461626c65)](https://packagist.org/packages/sectsect/wp-split-single-page) [![License](https://camo.githubusercontent.com/ea0bba47f5859095ac8f4cadc4e6a796f36ee707c0aacc319389c4b98e180fb3/68747470733a2f2f706f7365722e707567782e6f72672f73656374736563742f77702d73706c69742d73696e676c652d706167652f6c6963656e7365)](https://packagist.org/packages/sectsect/wp-split-single-page)

#### - For Each Array of custom field -

[](#--for-each-array-of-custom-field--)

### Supply some functions and Pagination for split single page for each array of custom field without `` on your template.

[](#supply-some-functions-and-pagination-for-split-single-page-for-each-array-of-custom-field-without---nextpage---on-your-template)

Installation
------------

[](#installation)

##### 1. Clone this Repo into your `wp-content/plugins` directory.

[](#1-clone-this-repo-into-your-wp-contentplugins-directory)

```
$ cd /path-to-your/wp-content/plugins/
$ git clone git@github.com:sectsect/wp-split-single-page.git

```

##### 2. Activate the plugin through the 'Plugins' menu in WordPress.

[](#2-activate-the-plugin-through-the-plugins-menu-in-wordpress)

That's it:ok\_hand:

Notes
-----

[](#notes)

- Supports `is_preview()` Page. See [Usage Example](#usage-example).
- Supports Wordpress Plugin [Public Post Preview](https://github.com/ocean90/public-post-preview)
- Supports Wordpress Plugin [CF Preview Fix](https://wordpress.org/plugins/cf-preview-fix/) for Cloudfront :memo: You need to manually add the following two parameters to the URL output by CF Preview Fix.

```
&post_date=20171231021559&preview_time=20171231021604

```

functions
---------

[](#functions)

FunctionDescription`is_single_paged($num)`Detect the specific splitted page number.
( Return: `boolean` )`single_paginate($args)`Get the Pagination.
( Based on `paginate_links()` [Codex](https://codex.wordpress.org/Function_Reference/paginate_links) )`prev_single_paged_link($pagecount, $paged, $label, $type)`Get the Previous Split Single Page link`next_single_paged_link($pagecount, $paged, $label, $type)`Get the Next Split Single Page link`add_rel_prev_next_paginated_posts($pagecount)`Get `rel="prev"` and `rel="next"` links
See [Indicating paginated content to Google](https://support.google.com/webmasters/answer/1663744)#### `single_paginate($args)`

[](#single_paginateargs)

Default Arguments

```
$args = array(
    'base'               => get_the_permalink() . '%#%/',	// (is_preview()) get_the_permalink() . '&paged=%#%'
    'format'             => get_the_permalink() . '%#%/',	// (is_preview()) get_the_permalink() . '&paged=%#%'
    'total'              => 1,
    'current'            => 0,
    'show_all'           => false,
    'end_size'           => 1,
    'mid_size'           => 2,
    'prev_next'          => true,
    'prev_text'          => __('&laquo; Previous'),
    'next_text'          => __('Next &raquo;'),
    'type'               => 'list',
    'add_args'           => false,
    'add_fragment'       => '',
    'before_page_number' => '',
    'after_page_number'  => '',
);
```

**TIP:** `'base'` and `'format'` Silence is golden 👍

#### `next_single_paged_link($pagecount, $paged, $label, $type)`

[](#next_single_paged_linkpagecount-paged-label-type)

##### Parameters

[](#parameters)

- **pagecount**`(integer)` The total number of pages.
- **paged**`(integer)` The current page number.
- **label**`(string)` (Optional) Link text to display. Default: `'Next'`
- **type**`(string)` (Optional) Controls format of the returned value. Possible values are:

    - **'plain'** - `Next`
    - **'list'** - `Next`

    Default: `'plain'`

#### `add_rel_prev_next_paginated_posts($pagecount)`

[](#add_rel_prev_next_paginated_postspagecount)

##### Parameters

[](#parameters-1)

- **pagecount**`(integer)` The total number of pages.

Usage Example
-------------

[](#usage-example)

#### single.php

[](#singlephp)

NOTE: Split the page by array (w/ [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/) Plugin).

```
