{"id":15292238,"url":"https://github.com/parfaitementweb/wordpress-starter-theme","last_synced_at":"2025-10-07T04:32:03.761Z","repository":{"id":57035901,"uuid":"167389394","full_name":"parfaitementweb/wordpress-starter-theme","owner":"parfaitementweb","description":"This Wordpress starter theme is built with Modern PHP development practises in mind.","archived":true,"fork":false,"pushed_at":"2021-10-07T07:50:44.000Z","size":210,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-11T19:26:16.713Z","etag":null,"topics":["laravel","tailwindcss","wordpress"],"latest_commit_sha":null,"homepage":null,"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/parfaitementweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-24T15:24:19.000Z","updated_at":"2023-12-25T06:29:24.000Z","dependencies_parsed_at":"2022-08-24T14:10:34.219Z","dependency_job_id":null,"html_url":"https://github.com/parfaitementweb/wordpress-starter-theme","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parfaitementweb%2Fwordpress-starter-theme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parfaitementweb%2Fwordpress-starter-theme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parfaitementweb%2Fwordpress-starter-theme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parfaitementweb%2Fwordpress-starter-theme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parfaitementweb","download_url":"https://codeload.github.com/parfaitementweb/wordpress-starter-theme/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235586527,"owners_count":19014035,"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":["laravel","tailwindcss","wordpress"],"created_at":"2024-09-30T16:17:03.511Z","updated_at":"2025-10-07T04:31:58.188Z","avatar_url":"https://github.com/parfaitementweb.png","language":"PHP","readme":"# Wordpress Starter Theme, done *Parfaitement*.\n\nThis Wordpress starter theme is built with Modern PHP development practises in mind.\n\nThis starter theme is based on the underscores.me file structure and only includes an additional and optional set of tools to ease your development.  You can and will still develop your theme as any other basic Wordpress Theme.\n\n## The theme includes out-of-the-box\n- Composer\n- Laravel Views Blade\n- Controllers\n- Laravel Mix\n- Custom Gutenberg Blocks using ACF Blocks\n- Laravel Collections\n- Strings Helpers\n- Tailwind CSS\n---\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/parfaitementweb/wordpress-starter-theme.svg?style=flat-square)](https://packagist.org/packages/parfaitementweb/wordpress-starter-theme)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Total Downloads](https://img.shields.io/packagist/dt/parfaitementweb/wordpress-starter-theme.svg?style=flat-square)](https://packagist.org/packages/parfaitementweb/wordpress-starter-theme)\n\n## Installation\nExecute the following commands:\n\n    cd wp-content/themes\n    composer create-project parfaitementweb/wordpress-starter-theme\n\n    cd yourtemplatename\n    npm install\n    npm run watch\n\n    # Build your assets for production using\n    # npm run production\n    # Read more about Laravel Mix on their official documentation.\n\n---\n\n## Controllers\nDefault Wordpress templates files (such as index.php, page.php, etc.) are now your Controllers.\nDefine in them all the logic for the specified template.\n\n### How to use\n1. The Wordpress template file should not directly return HTML or PHP code. \n2.  You should a call our core library using `$core = new Parfaitement\\Core;` . This is going to intantiate an object with a lot of the common functions we need across the site.\n3. Return your [Laravel Blade](https://laravel.com/docs/5.7/blade) using the `$core-\u003erender($view, $data)` method.\n    `$view` is the name of the view (without `.blade.php` extension).\n    `$data` is an array of variables you want to pass to the view.\n\n    \u003e Views are saved under the resources/views folder.\n\nThe `$core` variable offers additional features:\n- Access The [Laravel HTTP Request](https://laravel.com/docs/5.7/requests) using `$core-\u003e$request`\nIt's useful for retrieving input with `$core-\u003erequest-\u003einput('name')` by exemple.\n- Inject specific a CSS file for **this template only** using `$core-\u003einclude_style()`\n- Inject specific a JS file for **this template only** using `$core-\u003einclude_script()`\n\n\n## Views\nBlade views `*.blade.php` are stored under the `resources/views` folder and are parsed using the [Laravel Blade](https://laravel.com/docs/5.7/blade) template engine.\n\n## Assets\nAll assets are stored in the ``resources/assets`` folder. Normally as follow:\n\n - resources/assets/images\n - resources/assets/js\n - resources/assets/sass\n\nAssets are compiled using [Laravel Mix](https://laravel-mix.com/docs/4.0/basic-example).\nLaravel Mix is a clean layer on top of webpack to make the 80% use case laughably simple to execute.\n\nOut-of-the box, it includes:\n- Minification \u0026 Compression\n- JS with ES2017, Vue Support, Hot Replacement\n- CSS Preprocessors. LESS, SASS, Stylus \u0026 PostCss\n- Browsersync\n- Cache-busting (Automatic versioning)\n\n\u003e CSS files are processed using *POSTCSS* by default.\n\n#### mix()\nWe've added support for the `mix()` helper for cache-busting from within your template.\nWhen using `$core-\u003einclude_style()` or `$core-\u003einclude_script()` in your controllers, your scripts ans styles will be automatically cache-busted.\n\n#### Linking to assets from templates\nLink your assets (images, icon, ...) using our custom `asset()` helper.\n\n    \u003cimg src=\"{{ asset('/images/logo.png') }}\" /\u003e`\n\n\n## Tailwind CSS\nThis theme comes with [Tailwind CSS](https://tailwindcss.com), an utility-CSS framework pre-installed. You can still remove it form the `package.json` dependencies and edit the CSS style as you like.  \n\n\u003e CSS files are processed using *POSTCSS* by default.\n\u003e\n## Forms\nCustom Form can be handle this way:\n\nIn your `page.php`\n\n    $validator = $core-\u003evalidation-\u003emake(\n        $core-\u003erequest-\u003einput(),\n        [\n            'name' =\u003e 'required',\n            // other rules\n        ]\n    );\n\n    if ($validator-\u003efails()) {\n        $errors = $validator-\u003eerrors();\n    }\n\n    $data = [\n        'errors' =\u003e $errors\n    ];\n    $core-\u003erender('page', $data);\n\nIn your page.blade.php\n\n        @if (isset($errors) \u0026\u0026 $errors-\u003eany())\n            \u003cdiv class=\"alert alert-danger\" role=\"alert\"\u003e\n                @foreach ($errors-\u003eall() as $error)\n                    \u003cp\u003e{{$error}}\u003c/p\u003e\n                @endforeach\n            \u003c/div\u003e\n        @endif\n\n        \u003cform action=\"{{ site_url() }}/wp-admin/admin-post.php\" method=\"post\"\u003e\n            \u003c?php wp_nonce_field('contact_form') ?\u003e\n\n            \u003cinput type=\"hidden\" name=\"action\" value=\"contact_form\"\u003e\n            \u003cinput type=\"text\" name=\"name\" placeholder=\"Your Name\"\u003e\n\n            \u003cinput type=\"submit\" value=\"Submit\"\u003e\n        \u003c/form\u003e\n\nIn `app/ContactForm/php`\n\n    \u003c?php\n\n    namespace App;\n\n    class ContactForm\n    {\n        public function __construct()\n        {\n            add_action('admin_post_nopriv_contact_form', [$this, 'handle_contact_form']);\n            add_action('admin_post_contact_form', [$this, 'handle_contact_form']);\n        }\n\n        function handle_contact_form()\n        {\n            if (wp_verify_nonce($_POST['_wpnonce'], 'contact_form')) {\n                $redirect = add_query_arg('form', 'success', site_url('contact'));\n                wp_redirect($redirect);\n            }\n        }\n    }\n\nAdd this in your `functions.php` under Custom Functions section.\n\n    $contactForm = new \\App\\ContactForm();\n\n### Validation\nOur core had support for [Laravel Validation](https://laravel.com/docs/5.7/validation).\n\n## Helpers\nHere is below a list of additional helpers you can use anywhere in your theme.\n\n#### Collections.\nWe added support for [Laravel Collections](https://laravel.com/docs/5.5/collections).\n\n#### Arrays \u0026 Strings\nYou can use any **Arrays \u0026 Objects** and **Strings** Laravel Helper listed here: https://laravel.com/docs/5.7/helpers\n\n#### Dump \u0026 Die\nWe've also add support for the famous `dd()` (\"dump and die\") helper function. This function dumps the variables using dump() and immediately ends the execution of the script (using exit).\n\n## Custom Theme Functions\n\nAll PHP Class files placed under the `/app` folder will be autoloaded and accessible throughout your theme files. Use them for a convienent and testable place to store your custom logic.\n\n    \u003c?php\n\n    namespace App;\n\n    class Custom\n    {\n        public function get_articles()\n        {\n            return [\n                'article' =\u003e 'foo',\n                'title' =\u003e 'bar'\n            ];\n        }\n    }\n\n    ?\u003e\n\n    ## Usage\n    $custom = new \\App\\Custom();\n    $articles = $custom-\u003eget_articles();\n\n\n## Classic Editor\nThe [Classic Editor plugin](https://wordpress.org/plugins/classic-editor/) is included in the Composer dependencies. Using this command todownload and install it in your Wordpress default plugins folder.\n\u003eYou still need to manually activate the plugin in the Plugins page.\n\n    composer install\n\n## Gutenberg ACF Blocks\nThis starter theme supports ACF Blocks for easy Gutenberg Block creation. Please read the [ACF Blocks Documentation](https://www.advancedcustomfields.com/resources/blocks/) to learn how to proceed.\nIn this theme, the blocks are registered in the `inc/acf-blocks.php` file. Views for the blocks are rendered from the `/resources/views/blocks` folder.\n\n\u003e The Blocks views does not support Laravel Balde synthax. Regular PHP is needed.\n\n## Cleaner Wordpress\nWe've included several classes to offer a cleaner version of Wordpress by default.\n\nYou can enable or disable any of them by copying the `.env.example` configuration file at the root of your theme folder to `.env` and customize its content with the following options:\n\n| Option | Default | Description |\n|---|---|---|\n| DISABLE_COMMENTS | true | Disables all comments features |\n| DISABLE_EMOJIS | true |  Disables emojis scripts |\n| DISABLE_GENERATOR | true | Removes Generator meta tag |\n| DISABLE_GUTENBERG_BLOCK | true | Removes Block Library scripts |\n| DISABLE_OEMBED | true | Disable oEmebed scripts |\n| HIDE_FRONTEND_TOOLBAR | true | Hides the admin toolbar on front and hides the option in the Profile Options page. |\n| HIDE_FRONTPAGE_ADMIN_ATTRS | true | Hides the page attributes in the admin when editing the frontpage. |\n| ADD_SLUG_BODY_CLASS | true | Add the current slug to the body classes list. |","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparfaitementweb%2Fwordpress-starter-theme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparfaitementweb%2Fwordpress-starter-theme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparfaitementweb%2Fwordpress-starter-theme/lists"}