{"id":17780765,"url":"https://github.com/regisphilibert/wp-jumpstart","last_synced_at":"2026-05-07T15:36:05.211Z","repository":{"id":77623346,"uuid":"116707017","full_name":"regisphilibert/wp-jumpstart","owner":"regisphilibert","description":"A Wordpress Theme Boilerplate with a view","archived":false,"fork":false,"pushed_at":"2018-08-18T19:55:25.000Z","size":3904,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T16:43:01.604Z","etag":null,"topics":["api","grunt","php","sass","seo","theme","wordpress","wordpress-theme-boilerplate"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/regisphilibert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-01-08T17:28:47.000Z","updated_at":"2022-02-12T14:04:09.000Z","dependencies_parsed_at":"2023-02-25T11:45:14.835Z","dependency_job_id":null,"html_url":"https://github.com/regisphilibert/wp-jumpstart","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/regisphilibert/wp-jumpstart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regisphilibert%2Fwp-jumpstart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regisphilibert%2Fwp-jumpstart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regisphilibert%2Fwp-jumpstart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regisphilibert%2Fwp-jumpstart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/regisphilibert","download_url":"https://codeload.github.com/regisphilibert/wp-jumpstart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regisphilibert%2Fwp-jumpstart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32744070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["api","grunt","php","sass","seo","theme","wordpress","wordpress-theme-boilerplate"],"created_at":"2024-10-27T03:03:49.711Z","updated_at":"2026-05-07T15:36:05.203Z","avatar_url":"https://github.com/regisphilibert.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jumpstart is a Wordpress Theme Boilerplate with a view...\n\nI created Jumpstart 6 years ago and have been using, updating, improving it ever since.\n\nTo me, it takes a better approach of the \"view\" in the line of modern MVC including a better `get_template_part()` which solves the scope issue. \nPlus it bundles a lightweight API, an SEO logic you can tailor to your needs, an easy way to register and enqueue your scripts and many helper functions.\n\n## Setup:\n1. Download to themes directory.\n2. `cd wherever/it/is`\n3. `npm install`\n4. `grunt`\n5. Modify style.css for Wordpress theme directory (don't forget to credit)\n5. Activate theme.\n6. Start building on it.\n\n## A more modern aproach of the view\n\nI got tired of having every single wordpress view/template files at the root of my folder. I wanted one layout and view files organized like a modern MVC.\n\nThe index.php and the page template files (the ones starting with this one liner relic `/* Template Name: Contact */`) are the only ones who should need the `new jsTemplate()` in it.\nFor all the others, index.php's jsTemplate will do the guessing as long as you follow the `views/` file hierarchy:\n(Note that at the root of view directory sits your layouts, default is layout.php)\n\n```\n+-- layout.php\n+-- modal.php\n+-- includes (see Includes and partials below)\n|  +-- socials.php\n|  +-- well.php\n+-- default\n|  +-- 404.php (404 cannot depend on a post type)\n|  +-- archive.php\n|  +-- single.php\n+-- post\n|  +-- archive.php\n|  +-- single.php\n+-- page\n|  +-- single.php\n|  +-- templates\n|     +-- contact.php\n+-- recipe (custom post type)\n|  +-- archive.php\n|  +-- single.php\n```\n\n### Post types' views\nIf you use a prefix in your custom post type handle (as you should) it should be the one defined as _THEME_SHORTNAME_ so we can safely ommit it in its dirname detection)\nA post type without a view directory will default to the `default/` directory and its views.\n\n### Layouts\nDefault layout is at the root (layout.php). To use another layout, you need to change jsTemplate() second param as explained below.\n\n### Custom template page\nYour page template files should be stored in /page-templates and bear the same name as their view files to benefit from Jumpstart's view logic.\n\n#### If \n1/ You **don't** want to bother with this page template directory and naming logic you can still create them wherever and pass the slug of the view file (whithin `views/`) as first parameter:\n\n```php\n\u003c?php \n/* Template Name: Contact */ \nnew jsTemplate('here/there/contact');\n```\n\n2/ You need to use another layout than the default one, for exemple for a modal view of a post or whatever. Layout is the second parameter.\n```php\n\u003c?php \nnew jsTemplate(false, 'modal');\n```\n\n3/ You need a different layout and a view not relevant to post type logic:\n```php\n\u003c?php \nnew jsTemplate('error_landing', 'modal');\n```\n\n### Includes and partials\n\n#### The problem\nWordpress' `get_template_part()` is great to safely include pieces of your theme without risking a fatal error (typo in name or path) but it's a function with its own scope. \nIt can use the main wordpress variables ($post, $wp_query etc...) but doesn't care for your own.\nThis makes us use a lot of global declaration before a our `get_template_part()`. Declaration we have to remember to reset afterward to avoid variable conflicts.\n\n#### Jumpstart's `get_template_include()`\nJumpstart uses a function called get_template_include() which allows to pass variables as parameter to be used from the included part.\n\nThe function is in functions.php and uses the jsPartial class. It uses the same global declarations as WP core's `get_template_part()`: \n`global $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;`\n\nSo feel free to use those the usual way.\n\nFor your own variables (passed as parameter, you call them by using `$this-\u003esay('whatever')` for echo, or `$this-\u003eget('whatever')` for retrieving.\n\n#### Exemple\nThis is from `views/page/templates/home.php`, can see it on the homepage.\n```php\n\u003c?php get_template_include('well', ['class'=\u003e'phi-Well--alt']) ?\u003e\n```\n\nThis is from `views/includes/well.php`\n```html\n\u003cdiv class=\"phi-Well \u003c?php $this-\u003esay('class'); ?\u003e\"\u003e\n\tWell, well, well...\n\u003c/div\u003e\n```\n\n## src/\nsrc files processing is using [Bento--grunt](https://github.com/regisphilibert/phil--grunt).\nIt drops everything in a dist/ directory. You can check out the Gruntfile.js for more information.\n\n### SCSS\nIt is built for scss so grunt-contrib-sass is included on package.json\n\n### Less\nWhy not. The grunt code is commented in Gruntfile.js but ready to use. All you have to do is \n1. `npm install grunt-contrib-less --save-dev`\n2. `npm uninstall grunt-contrib-sass --save-dev` would make sense.\n2. Comment/Uncomment Gruntfiles scss/less lines.\n3. Create `src/less` directory and add your less files in it!\n\n## Helpers\nEverything is block commented here: `inc/helpers.php`\n\n## Localization\nYou can read more on [WordPress l18n practises](https://codex.wordpress.org/I18n_for_WordPress_Developers) but basically you need to:\n1. Create a `.pot` file to use as a template for your alternate languages.\n2. Create a `.po` file (from copying/pasting content fo the `.pot` ) for each languages.\n3. Generate a `.mo` file for each .po file.\n\nThe default text domain will be your global THEME_SHORTNAME. \nDefault language dir where `.pot`, `.po` and `.mo` are stored is /languages. \nChange to your linking in [functions.php](https://github.com/regisphilibert/wp-jumpstart/blob/master/functions.php#L11) and [Gruntfile.js](https://github.com/regisphilibert/wp-jumpstart/blob/master/Gruntfile.js#55).\n\nJumpstart only has one [localized chain](https://github.com/regisphilibert/wp-jumpstart/blob/master/views/includes/header.php#4). \n\n### Step 1\nWe use [grunt-wp-i18n](https://github.com/cedaro/grunt-wp-i18n)'s [makepot](https://github.com/cedaro/grunt-wp-i18n/blob/develop/docs/makepot.md) to generate the `.pot` file in the language directory:\n\n```\n$ grunt pot\n```\n\n### Step 2\nCreate the `.po` files for each languages and update their `msgstr` strings with appropriate translations. Name your files with the approriate local code (use [get_locale()](https://codex.wordpress.org/Function_Reference/get_locale) to make sure you're using the right code.\n\n### Step 3\nWe compile the `.mo` file for each languages.\n\n```\n$ grunt mo\n```\n\nChanges should reflect.\n\n## Bundles\n\nJumpstart has 3 self dependent optionnal bundles.\nSimply look at the `functions.php` defined constants to choose your needed bundles.\nOr just copy the files of any bundle and drop them in your existing Wordpress theme! They don't need Jumpstart.\n\n### Bundle::API\nIf you just need a few endpoints to output something for your javascript or tier service, this is a great time saver. If you need a deep REST API to output your posts you should turn to [WP REST API](http://v2.wp-api.org/)\n\nThis bundle adds an API page in your dashboard which will allow you to play with your methods and see their output.\n\nTo add methods \u003e [`bundles/api/Api.class.php`](bundles/api/Api.class)\nTo add methods to the WP API admin page \u003e [`bundles/api/Page.class.php`](bundles/api/Page.class.php) (see constructor)\n\n__This is a lightweight API__, use it if you're not fighting Fancy Bear or any famous hackers.\nIts only security wall is a unique key you must define as `API_KEY` either in your `wp-config.php` or in [`bundles/api/Api.class.php`](bundles/api/Api.class.php) (preferable)\nThe key must then be inserted in the endpoints urls:\n\n```\nhttp://yoursite.wp/api/{your_unique_key}/that_function\n```\nParams can be added with url parameters (`$_GET`)\n\n__IMPORTANT__: The unique key is added as a data-attr in the WP API Admin page. Which means that the key is exposed to any \"inspector aware\" wordpress user with the manage_option ability.\nNot trusting those? You can:\n* Change the protected $user_ability in [`bundles/api/Page.class.php`](bundles/api/Page.class.php)\n* Disable the WP API page by setting API_PAGE to 0 in [`bundles/api/_.php`](bundles/api/_.php)\n\n### Bundle::Options\n\nThis bundle allow easy creation of an option page with ACF Pro. It justs create the page, so you can add a field group to it with ACF. Nothing fancy.\n\n### Bundle::SEO\n\nThis is not really a bundle, but a class base to be extended or not as explained below.\n\n#### raw SEO\nIf all you need is basic SEO tags (og, twitter card, basic metas) which use wordpress logic to assign values: blog's description as description's meta, post_title as title, post thumbnail as image, post_excerpt as description etc... You can use it raw.\n\nYou will just need to add this to your theme's functions.php :\n```php\nadd_action('template_redirect', 'theme_start_seo', 50);\n\nfunction theme_start_seo(){\n    new jsSEO;\n}\n```\n#### Tailored SEO \nBut you will most likely need to enrich those basic metas and values with the particularities of your own theme. (custom post, custom fields as meta values etc...)\nTo do that, you will have to create a another class (to be stored wherever) which extends this one. You can check [`inc/custom-seo.php`](inc/custom-seo.php) for a use case.\n\nInside your `custom-seo.php`, you'll be able to overide the values for existings metas, and add your own metas tags.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregisphilibert%2Fwp-jumpstart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fregisphilibert%2Fwp-jumpstart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregisphilibert%2Fwp-jumpstart/lists"}