{"id":17222664,"url":"https://github.com/marksteve/wp-infinite-scroll","last_synced_at":"2026-05-20T14:33:53.962Z","repository":{"id":138471511,"uuid":"171067417","full_name":"marksteve/wp-infinite-scroll","owner":"marksteve","description":"Quick and easy infinite scrolling in WordPress","archived":false,"fork":false,"pushed_at":"2019-02-27T00:01:24.000Z","size":1556,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T16:21:13.587Z","etag":null,"topics":["infinite-scroll","javascript","wordpress"],"latest_commit_sha":null,"homepage":"https://marksteve.com/wp-infinite-scroll","language":"JavaScript","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/marksteve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-17T00:43:13.000Z","updated_at":"2019-02-27T00:01:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"2413c14c-8681-4cfe-9bb7-b9b7d4eb69bb","html_url":"https://github.com/marksteve/wp-infinite-scroll","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"f27dbcb95e75cfab2929f258ce4571a5c6b6fde0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marksteve/wp-infinite-scroll","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marksteve%2Fwp-infinite-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marksteve%2Fwp-infinite-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marksteve%2Fwp-infinite-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marksteve%2Fwp-infinite-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marksteve","download_url":"https://codeload.github.com/marksteve/wp-infinite-scroll/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marksteve%2Fwp-infinite-scroll/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265429152,"owners_count":23763694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["infinite-scroll","javascript","wordpress"],"created_at":"2024-10-15T04:06:03.878Z","updated_at":"2026-05-20T14:33:48.941Z","avatar_url":"https://github.com/marksteve.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wp-infinite-scroll\n\nQuick and easy infinite scrolling in WordPress. This library uses [enter-view.js](https://github.com/russellgoldenberg/enter-view/) to trigger loading on scroll and retireves posts through [WordPress' REST API](https://developer.wordpress.org/rest-api/) with the [Backbone.js client](https://developer.wordpress.org/rest-api/using-the-rest-api/backbone-javascript-client/).\n\n[Documentation](https://marksteve.com/wp-infinite-scroll) -\n[License](LICENSE)\n\n## Setup\n\nJust copy directly into your theme directory along with\n[enter-view.js](https://github.com/russellgoldenberg/enter-view/blob/master/enter-view.min.js).  You can then load it in your templates by adding these lines to `functions.php`:\n\n```php\nwp_enqueue_script('wp-api');\nwp_enqueue_script('enter-view', get_template_directory_uri() . '/js/enter-view.min.js', array(), '2.0.0', true);\nwp_enqueue_script('infinite-scroll', get_template_directory_uri() . '/js/infinite-scroll.js', array('wp-api', 'enter-view'), '0.0.1', true);\n```\n\n## Usage\n\nYou can use [any](https://github.com/wycats/handlebars.js) [templating](https://github.com/janl/mustache.js) [library](https://github.com/mde/ejs) for creating the post elements. In this example, we clone an existing post node and replace content and attributes with new post values.\n\n```js\ndocument.addEventListener('DOMContentLoaded', function () {\n  var template = document.querySelector('.posts \u003e .post:first-child').cloneNode(true)\n  function createElement (post) {\n    var el = template.cloneNode(true)\n    var featuredImage = post._embedded['wp:featuredmedia'][0].source_url\n    el.querySelector('.link').href = post.link\n    el.querySelector('.title').innerHTML = post.title.rendered\n    el.querySelector('.featured-image').src = featuredImage\n    el.querySelector('.excerpt').innerHTML = post.excerpt.rendered\n    el.querySelector('.date').textContent = new Date(post.date).toLocaleString(undefined, {\n      'year': 'numeric',\n      'month': 'long',\n      'day': 'numeric'\n    })\n    return el\n  }\n  infiniteScroll({\n    data: {\n      _embed: true,\n      per_page: 10,\n      filter: { order: 'DESC' }\n    },\n    container: '.posts',\n    more: '.more',\n    moreDisplay: 'inline-block',\n    offset: 0.25,\n    createElement: createElement\n  })\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarksteve%2Fwp-infinite-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarksteve%2Fwp-infinite-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarksteve%2Fwp-infinite-scroll/lists"}