{"id":48465486,"url":"https://github.com/sectsect/wp-split-single-page","last_synced_at":"2026-04-07T04:31:01.011Z","repository":{"id":57048169,"uuid":"60416467","full_name":"sectsect/wp-split-single-page","owner":"sectsect","description":"Helpers to split single page with each array of custom field on WordPress.","archived":false,"fork":false,"pushed_at":"2018-11-26T15:24:21.000Z","size":62,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-30T12:40:05.880Z","etag":null,"topics":["array","nextpage","pagination","single-page","split","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sectsect.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-04T15:20:26.000Z","updated_at":"2023-10-02T10:16:17.000Z","dependencies_parsed_at":"2022-08-23T18:51:02.576Z","dependency_job_id":null,"html_url":"https://github.com/sectsect/wp-split-single-page","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/sectsect/wp-split-single-page","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fwp-split-single-page","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fwp-split-single-page/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fwp-split-single-page/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fwp-split-single-page/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sectsect","download_url":"https://codeload.github.com/sectsect/wp-split-single-page/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fwp-split-single-page/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31500397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","nextpage","pagination","single-page","split","wordpress"],"created_at":"2026-04-07T04:31:00.148Z","updated_at":"2026-04-07T04:31:01.001Z","avatar_url":"https://github.com/sectsect.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://github-sect.s3-ap-northeast-1.amazonaws.com/logo.svg\" width=\"28\" height=\"auto\"\u003e WP Split Single Page\n[![Build Status](https://travis-ci.org/sectsect/wp-split-single-page.svg?branch=master)](https://travis-ci.org/sectsect/wp-split-single-page) [![PHP-Eye](https://php-eye.com/badge/sectsect/wp-split-single-page/tested.svg?style=flat)](https://php-eye.com/package/sectsect/wp-split-single-page) [![Latest Stable Version](https://poser.pugx.org/sectsect/wp-split-single-page/v/stable)](https://packagist.org/packages/sectsect/wp-split-single-page) [![License](https://poser.pugx.org/sectsect/wp-split-single-page/license)](https://packagist.org/packages/sectsect/wp-split-single-page)\n#### \\- For Each Array of custom field -\n\n### Supply some functions and Pagination for split single page for each array of custom field without `\u003c!--nextpage--\u003e` on your template.\n\n## Installation\n\n##### 1. Clone this Repo into your `wp-content/plugins` directory.\n```\n$ cd /path-to-your/wp-content/plugins/\n$ git clone git@github.com:sectsect/wp-split-single-page.git\n```\n##### 2. Activate the plugin through the 'Plugins' menu in WordPress.\u003cbr\u003e\n That's it:ok_hand:\n\n## Notes\n\n- Supports `is_preview()` Page. See [Usage Example](#usage-example).\n- Supports Wordpress Plugin [Public Post Preview](https://github.com/ocean90/public-post-preview)\n- Supports Wordpress Plugin [CF Preview Fix](https://wordpress.org/plugins/cf-preview-fix/) for Cloudfront\n:memo: You need to manually add the following two parameters to the URL output by CF Preview Fix.\n```\n\u0026post_date=20171231021559\u0026preview_time=20171231021604\n```\n\n## functions\n\n| Function | Description |\n| ------ | ----------- |\n| `is_single_paged($num)`  | Detect the specific splitted page number. \u003cbr\u003e( Return: `boolean` ) |\n| `single_paginate($args)` | Get the Pagination. \u003cbr\u003e( Based on `paginate_links()` [Codex](https://codex.wordpress.org/Function_Reference/paginate_links) ) |\n| `prev_single_paged_link($pagecount, $paged, $label, $type)` | Get the Previous Split Single Page link |\n| `next_single_paged_link($pagecount, $paged, $label, $type)` | Get the Next Split Single Page link |\n| `add_rel_prev_next_paginated_posts($pagecount)` | Get `rel=\"prev\"` and `rel=\"next\"` links\u003cbr\u003eSee [Indicating paginated content to Google](https://support.google.com/webmasters/answer/1663744) |\n\n#### `single_paginate($args)`\nDefault Arguments\n``` php\n$args = array(\n    'base'               =\u003e get_the_permalink() . '%#%/',\t// (is_preview()) get_the_permalink() . '\u0026paged=%#%'\n    'format'             =\u003e get_the_permalink() . '%#%/',\t// (is_preview()) get_the_permalink() . '\u0026paged=%#%'\n    'total'              =\u003e 1,\n    'current'            =\u003e 0,\n    'show_all'           =\u003e false,\n    'end_size'           =\u003e 1,\n    'mid_size'           =\u003e 2,\n    'prev_next'          =\u003e true,\n    'prev_text'          =\u003e __('\u0026laquo; Previous'),\n    'next_text'          =\u003e __('Next \u0026raquo;'),\n    'type'               =\u003e 'list',\n    'add_args'           =\u003e false,\n    'add_fragment'       =\u003e '',\n    'before_page_number' =\u003e '',\n    'after_page_number'  =\u003e '',\n);\n```\n**TIP:** `'base'` and `'format'` Silence is golden 👍\n\n#### `next_single_paged_link($pagecount, $paged, $label, $type)`\n##### Parameters\n\n* **pagecount**\n`(integer)` The total number of pages.\n\n* **paged**\n`(integer)` The current page number.\n\n* **label**\n`(string)` (Optional) Link text to display.\nDefault: `'Next'`\n\n* **type**\n`(string)` (Optional) Controls format of the returned value.\nPossible values are:\n   - **'plain'** - `\u003ca href=\"#\" rel=\"next\"\u003eNext\u003c/a\u003e`\n   - **'list'** - `\u003cli class=\"next\"\u003e\u003ca href=\"#\" rel=\"next\"\u003eNext\u003c/a\u003e\u003c/li\u003e`\n\n   Default: `'plain'`\n\n#### `add_rel_prev_next_paginated_posts($pagecount)`\n##### Parameters\n\n* **pagecount**\n`(integer)` The total number of pages.\n\n\n## Usage Example\n\n#### single.php\nNOTE: Split the page by array (w/ [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/) Plugin).\n\n``` php\n\u003chead\u003e\n    \u003c?php\n    if ( is_single() \u0026\u0026 function_exists( 'add_rel_prev_next_paginated_posts' ) ) {\n      add_rel_prev_next_paginated_posts( count ( CFS()-\u003eget('page') ) );\n    }\n    ?\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003c?php get_header(); ?\u003e\n\n    \u003c?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?\u003e\n    \u003carticle\u003e\n        \u003ch1\u003e\u003c?php the_title(); ?\u003e\u003c/h1\u003e\n\n        \u003c?php if ( is_single_paged( 1 ) ) : ?\u003e\n            \u003csection\u003e\n                The first page only.\n            \u003c/section\u003e\n        \u003c?php endif; ?\u003e\n\n        \u003c?php\n            $pages = CFS()-\u003eget('page');               // Get the array of Loop-field\n            $pages = array_values( (array) $pages );   // Reset array Keys\n            if ( ! is_preview() ) {\n                $paged = ( get_query_var('page') ) ? get_query_var('page') : 1;\n            } else {\n                if ( isset( $_GET['paged'] ) ) {\n                    $pagenum = (int) wp_unslash( $_GET['paged'] );\n                }\n                $paged = ( $pagenum ) ? $pagenum : 1;\n            }\n            $pagecount = count( $pages );\n            $key       = $paged - 1;    // \"-1\" For Array's key\n            $page      = $pages[$key];\n        ?\u003e\n        \u003csection\u003e\n            \u003c?php if ( $page['h2'] ) : ?\u003e\n                \u003ch2\u003e\u003c?php echo $page['h2']; ?\u003e\u003c/h2\u003e\n            \u003c?php endif; ?\u003e\n\n            \u003c?php if ( $page['h3'] ) : ?\u003e\n                \u003ch3\u003e\u003c?php echo $page['h3']; ?\u003e\u003c/h3\u003e\n            \u003c?php endif; ?\u003e\n\n            \u003c?php if ( $page['text'] ) : ?\u003e\n                \u003c?php echo $page['text']; ?\u003e\n            \u003c?php endif; ?\u003e\n        \u003c/section\u003e\n\n        \u003c?php if ( is_single_paged( $pagecount ) ) : ?\u003e\n        \u003csection\u003e\n            The last page only.\n        \u003c/section\u003e\n        \u003c?php endif; ?\u003e\n\n        \u003csection class=\"pagenation\"\u003e\n            \u003c?php\n                if ( function_exists('single_paginate') ) {\n                    $args = array(\n                        'total'    =\u003e $pagecount,\n                        'current'  =\u003e $paged,\n                    );\n                    single_paginate($args);\n                }\n            ?\u003e\n        \u003c/section\u003e\n\n        \u003csection class=\"prev-next\"\u003e\n            \u003cul\u003e\n                \u003c?php\n                    prev_single_paged_link( $pagecount, $paged, \"PREV\", \"list\" );\n                    next_single_paged_link( $pagecount, $paged, \"NEXT\", \"list\" );\n                ?\u003e\n            \u003c/ul\u003e\n        \u003c/section\u003e\n    \u003c/article\u003e\n    \u003c?php endwhile; endif; ?\u003e\n\n    \u003c?php get_footer(); ?\u003e\n\u003c/body\u003e\n```\n\n## Change log\n * **1.4.0** - Specify canonical URL in canonical meta tag\n * **1.3.0** - Add New function `add_rel_prev_next_paginated_posts()`\n * **1.2.8** - Rename a function to `is_perm_trailingslash()`\n * **1.2.7** - Improve some codes for comparing same types\n * **1.2.6** - :bug: Fix bug in function `is_single_paged()`\n * **1.2.5** - :bug: Fix bug for navigation links when the permalink setting has no Trailing Slash\n * **1.2.4** - :bug: Fix PHP Notice for Undefined variable\n * **1.2.3** - Add PHP Unit Testing w/phpunit via TravisCI\n * **1.2.2** - Add support that permalink setting has no Trailing Slash. And Support Plugin [CF Preview Fix](https://wordpress.org/plugins/cf-preview-fix/) for Cloudfront (w/ conditions).\n * **1.2.1** - Add composer.json\n * **1.2.0** - Add Support Wordpress Plugin [Public Post Preview](https://github.com/ocean90/public-post-preview)\n * **1.1.0** - Add New functions `prev_single_paged_link()` and `next_single_paged_link()`\n * **1.0.0** - :tada: Initial Release\n\n  See [CHANGELOG](https://github.com/sectsect/wp-split-single-page/blob/master/CHANGELOG.md) file.\n\n## License\nSee [LICENSE](https://github.com/sectsect/wp-split-single-page/blob/master/LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectsect%2Fwp-split-single-page","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsectsect%2Fwp-split-single-page","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectsect%2Fwp-split-single-page/lists"}