{"id":20164886,"url":"https://github.com/somoscuatro/sc-starter-theme","last_synced_at":"2025-05-07T00:33:06.613Z","repository":{"id":229837404,"uuid":"776031354","full_name":"somoscuatro/sc-starter-theme","owner":"somoscuatro","description":"A custom starter theme for WordPress projects.","archived":false,"fork":false,"pushed_at":"2024-06-07T10:49:49.000Z","size":500,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-18T23:03:21.969Z","etag":null,"topics":["starter-theme","wordpress","wordpress-starter-theme","wordpress-theme"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/somoscuatro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-22T14:40:43.000Z","updated_at":"2024-08-22T19:57:51.000Z","dependencies_parsed_at":"2024-06-07T11:53:36.341Z","dependency_job_id":"d0f0fba4-e74b-4ccb-b06c-a30c48850ab7","html_url":"https://github.com/somoscuatro/sc-starter-theme","commit_stats":null,"previous_names":["somoscuatro/sc-starter-theme"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somoscuatro%2Fsc-starter-theme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somoscuatro%2Fsc-starter-theme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somoscuatro%2Fsc-starter-theme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somoscuatro%2Fsc-starter-theme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/somoscuatro","download_url":"https://codeload.github.com/somoscuatro/sc-starter-theme/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252792346,"owners_count":21804952,"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":["starter-theme","wordpress","wordpress-starter-theme","wordpress-theme"],"created_at":"2024-11-14T00:35:59.793Z","updated_at":"2025-05-07T00:33:03.811Z","avatar_url":"https://github.com/somoscuatro.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Somoscuatro Starter Theme for WordPress\n\nWelcome to the official repository of the Somoscuatro Starter Theme, designed\nspecifically for WordPress projects.\n\nThis theme leverages the power of [Advanced Custom Fields\n(ACF)](https://www.advancedcustomfields.com/) to craft custom Gutenberg Blocks,\nintegrates [Twig](https://twig.symfony.com/) via\n[Timber](https://upstatement.com/timber/) for efficient template management, and\nutilizes [Tailwind CSS](https://tailwindcss.com/) for its modern and responsive\nstyling capabilities. Additionally, it incorporates [Laravel\nMix](https://laravel-mix.com/), a wrapper for easily defining\n[Webpack](https://webpack.js.org/) build steps and efficiently compile assets.\nFurthermore, the theme supports [Storybook](https://storybook.js.org/), a tool\nfor developing UI components in isolation, which enhances the design system and\nfacilitates a more interactive component library.\n\n**Key Features:**\n\n- Custom Gutenberg Blocks: Build unique and complex content layouts with ease\n  using ACF.\n- Twig Templating: Write maintainable and cleaner code with the power of Twig\n  and Timber.\n- Responsive Design: Achieve a consistent look across all devices with Tailwind\n  CSS.\n- TypeScript Integration: Enhance code reliability and maintainability with\n  strong typing through TypeScript support.\n- Assets Compilation: Simplify your assets management with Laravel Mix's\n  straightforward Webpack wrapper.\n- Storybook Integration: Develop and test UI components in isolation and\n  checking them using Storybook interactive environment.\n\n## Prerequisites\n\nTo ensure a seamless installation and optimal functionality of this theme,\nplease ensure that your system meets the following requirements:\n\n- [PHP](https://www.php.net/): Version 8.2 or higher\n- [Composer](https://getcomposer.org/): Version 2.7 or higher\n- [Node.js](https://nodejs.org/en): Version 18 or higher\n- [pnpm](https://pnpm.io/): Version 8.15 or higher\n- [GitHub CLI](https://cli.github.com/): Version 2.49 or higher (optional, necessary for [deployment scripts](#automated-deployment) to work)\n\n### Quick Start with Docker\n\nFor those looking to quickly and effortlessly set up a local WordPress\nenvironment, we recommend exploring our\n[docker-wordpress-local](https://github.com/somoscuatro/docker-wordpress-local)\nrepository. It provides a Docker-based solution to get your WordPress instance\nup and running in no time.\n\n## Setup\n\nFollow these instructions to get the Somoscuatro Starter Theme up and running on\nyour WordPress site:\n\n1. **Clone the Repository:**\n\n   Begin by cloning the repository into your WordPress themes directory. Open\n   your terminal, navigate to the `wp-content/themes` folder of your WordPress\n   installation, and run the following command:\n\n    `git clone git@github.com:somoscuatro/sc-starter-theme.git`\n\n    After cloning, switch to the theme's directory:\n\n    `cd sc-starter-theme`\n1. **Install Dependencies:**\n\n   Install the required Node.js and PHP dependencies by running:\n\n   `pnpm install \u0026\u0026 composer install`\n\n   This will set up all necessary packages for the theme to function correctly.\n1. **Build Assets:**\n\n   Compile the static assets such as CSS and JavaScript files with:\n\n   `pnpm run build`\n\n   This command processes your assets using Laravel Mix and prepares them for\n   production use.\n1. **Activate the Theme:**\n\n   To activate the theme on your WordPress site, you can use the WP CLI with the\n   following command:\n\n   `wp theme activate sc-starter-theme`\n\n   Alternatively, you can activate the theme manually by going to the WordPress\n   admin dashboard, navigating to _Appearance_ \u003e _Themes_, and clicking the\n   _Activate_ button for the Somoscuatro Starter Theme.\n\nEnjoy your new theme! To learn how to further customize and extend it, keep on\nreading.\n\n## Understanding the Theme Structure\n\nOur objective is to harness modern Object-Oriented Programming (OOP) practices\nin PHP, adhering to recommended coding standards. This approach ensures a\nwell-organized and readable codebase without compromising on performance.\n\nWe structure our code by grouping related functionalities within classes. This\nmodular design promotes clean and maintainable code. To streamline the inclusion\nof these classes, we implement class autoloading (see section [Class\nAutoloading](#class-autoloading)).\n\nAdditionally, we utilize [methods\nattributes](https://www.php.net/manual/en/class.attribute.php) to manage\nWordPress hooks efficiently. This method allows us to keep our actions and\nfilters handlers organized and easily traceable within the class context. See\nsection [WordPress Hooks Usage](#wordpress-hooks-usage).\n\n### Directories Organizations\n\nThe Somoscuatro Starter Theme is organized into several directories, each\nserving a specific purpose in the theme's architecture:\n\n- `assets`: This directory houses all the static resources used by the theme.\n  - `fonts`: Contains custom fonts files. See [How to Customize\n    Fonts](#how-to-customize-fonts) section.\n  - `images`: Stores static images that are integral to the theme's\n  construction. Place assets such as favicons or any other images that you\n  prefer to manage directly within the theme, rather than through the WordPress\n  Media Uploader, here.\n  - `scripts`: Holds the JavaScript files that add interactive functionality to\n  your theme.\n  - `styles`: Contains all the Tailwind CSS and custom style files that define\n  the visual appearance of your theme.\n- `languages`: This directory contains the translation files. See\n  [Translations](#translations) section.\n- `patches`: Sometimes, third-party libraries require modifications to work\n  seamlessly with our theme. This directory contains such modifications, or\n  \"patches.\" For example, we include a patch to ensure [WP CLI\n  Stubs](https://github.com/php-stubs/wp-cli-stubs) are compatible with PHP 8.2.\n  These patches are automatically applied when you run `composer install`. For\n  details on how these patches are implemented, refer to the `post-install-cmd`\n  script within the `composer.json` file.\n- `src`: Serving as the primary namespace for the theme, this directory contains\n  all the core logic, neatly organized into distinct classes.\n  - `attributes`: This subdirectory houses the mechanism for registering\n  WordPress hooks using PHP method attributes. Within, the `hooked-classes.php`\n  file enumerates classes that have methods designed to handle WordPress hooks.\n  - `blocks`: Custom Gutenberg blocks are stored here, each in its own dedicated\n  folder for better organization. See [How to Create Gutenberg\n  Blocks](#how-to-create-gutenberg-blocks) section.\n  - `cli`: This is where we implement custom WP-CLI commands, extending the\n  command-line interface capabilities for WordPress.\n  - `custom-post-types`: Definitions and configurations for WordPress Custom\n  Post Types are located in this subdirectory. See [How to Add Custom Post\n  Types](#how-to-add-custom-post-types) section.\n  - `custom-taxonomies`: Similarly, this subdirectory is dedicated to the\n  definition of WordPress Custom Taxonomies. See [How to Add Custom\n  Taxonomies](#how-to-add-custom-taxonomies) section.\n  - `helpers`: A collection of generic utility methods implemented as PHP Traits\n  can be found here. An example includes a method for retrieving the last\n  modified time of a file.\n- `templates`: This directory is home to the Twig templates used by the theme.\n  - `parts`: Here, you'll find reusable template partials.\n\n### Class Autoloading\n\nThe `autoloader.php` file is responsible for implementing a class autoloader\nthat adheres to [the WordPress naming conventions for classes and\nfiles](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#naming-conventions).\n\nAdditionally, this autoloader invokes the Composer autoloader, guaranteeing that\nany third-party dependencies are also loaded automatically.\n\n### Dependency Injection\n\nThe theme uses [PHP DI](https://php-di.org/) for Dependency Injection.\n\n### WordPress Hooks Usage\n\nWe utilize [methods\nattributes](https://www.php.net/manual/en/class.attribute.php) to manage\nWordPress hooks efficiently. This approach allows us to keep our actions and\nfilters handlers organized and easily traceable within the class context.\n\nOur inspiration came from an insightful article by Markus Kober: [How to\nregister WordPress hooks with PHP attributes: A step-by-step\nguide](https://marcuskober.com/registering-wordpress-hooks-effectively-with-php-attributes/).\n\nTo use method attributes in your class methods, follow these steps:\n\n1. **Define Your Class Method:**\n\n   Write the method that you intend to use as a hook handler. For instance:\n\n   ```php\n    // src/class-my-beautiful-class.php\n\n    namespace Somoscuatro\\Starter_Theme;\n\n    class My_Beautiful_Class {\n\n      public function my_beautiful_method(): void {\n        // Your code here\n      }\n    }\n   ```\n\n1. **Register the Method as a Hook Handler:**\n\n   Apply the method attribute to register it as a handler for a WordPress action\n   or filter. Here's how you would register a method for the `after_setup_theme`\n   action:\n\n   ```php\n    // src/class-my-beautiful-class.php\n\n    namespace Somoscuatro\\Starter_Theme;\n\n    use Somoscuatro\\Starter_Theme\\Attributes\\Action;\n\n    class My_Beautiful_Class {\n\n      #[Action('after_setup_theme')]\n      public function my_beautiful_method(): void {\n        // Your code here\n      }\n    }\n   ```\n\n   Similarly, for a filter like `body_class`, you would write:\n\n   ```php\n    // src/class-my-beautiful-class.php\n\n    namespace Somoscuatro\\Starter_Theme;\n\n    use Somoscuatro\\Starter_Theme\\Attributes\\Filter;\n\n    class My_Beautiful_Class {\n\n      #[Filter('body_class')]\n      public function my_beautiful_method(array $classes): array {\n        // Your code here\n\n        return $classes;\n      }\n    }\n   ```\n\n1. **Specify Priority and Accepted Arguments (Optional):**\n\n   You can also define the priority of the hook and the number of accepted\n   arguments like this:\n\n   ```php\n   #[Filter('style_loader_tag', priority: 20, accepted_args: 2)]\n   ```\n\n   If not explicitly stated, the default priority is set to 10, and the number\n   of accepted arguments is 1.\n\n   Please note that class methods linked to hooks must be public to ensure\n   WordPress can call them correctly.\n\n1. **Register Hooked Classes in hooked-classes.php:**\n\n   To activate the hooked methods, you must register the class containing them\n   in the `hooked-classes.php` file. This step is essential to automatically\n   attach your methods to the specified WordPress hooks. Add your class to the\n   list as shown below:\n\n     ```php\n       // hooked-classes.php\n\n       use Somoscuatro\\Starter_Theme\\My_Beautiful_Class;\n\n       return [\n         // Other classes\n         My_Beautiful_Class::class,\n       ];\n     ```\n\n## How to Customize Fonts\n\nThe starter theme includes two example custom fonts,\n[Jost](https://fonts.google.com/specimen/Jost?query=jost) and\n[Syne](https://fonts.google.com/specimen/Syne?query=syne), to demonstrate how\nyou can incorporate your own font choices.\n\nTo integrate your custom fonts into the theme, follow these steps:\n\n1. **Add Your Fonts:**\n\n   Download your chosen fonts and place them in the `assets/fonts` directory.\n   For the best balance of efficiency and compatibility, we recommend using the\n   WOFF2 format.\n\n1. **Preload Your Fonts:**\n\n   Improve your site's performance by preloading your fonts. In the\n   `templates/partials/head.twig` file, insert a preload link for each font. For\n   example:\n\n    ```html\n    \u003clink rel=\"preload\" href=\"{{ get_static_asset('dist/fonts/my-beautiful-font.woff2') }}\" as=\"font\" type=\"font/woff2\" crossorigin=\"anonymous\"\u003e\n    ```\n\n    For a deeper understanding of preloading strategies, consider reading [this\n    informative blog post by\n    Google](https://web.dev/articles/codelab-preload-web-fonts).\n\n1. **Define Font-Face:**\n\n   Declare your font in `assets/styles/fonts.css` using the `@font-face` rule to\n   specify the font family, style, weight, and file source. Here's an example:\n\n    ```css\n    @supports (font-variation-settings: normal) {\n      @font-face {\n        font-family: 'My Beautiful Font';\n        font-style: normal;\n        font-weight: 300 700;\n        font-display: swap;\n        src: url(/wp-content/themes/sc-starter-theme/dist/fonts/my-beautiful-font.woff2) format(\"woff2\");\n      }\n    }\n    ```\n\n1. **Configure Tailwind:**\n\n   Let Tailwind CSS know about your new font by updating the\n   `tailwind.config.js` file. Add your font to the `extend` section under\n   `fontFamily`. Here's how you can do it:\n\n   ```js\n   extend: {\n     fontFamily: {\n       'myBeautifulFont': ['My Beautiful Font', 'Helvetica Neue', 'Arial', 'sans-serif'],\n     },\n   }\n   ```\n\n1. **Apply Your Font:**\n\n   Now you can use your custom font throughout the theme by applying the\n   Tailwind class `font-my-beautiful-font` wherever you want your font to\n   appear.\n\n## How to Customize Color Palette\n\nThe starter theme includes a predefined color palette tailored to provide a\ncohesive visual design. To personalize this palette to match your brand or\ndesign preferences, follow these steps:\n\n1. **Modify Tailwind Colors Palette:**\n\n   Update your custom color palette by adding your desired HEX codes to the\n   `tailwind.colors.json` file. This file dictates the color scheme used\n   throughout the theme via Tailwind CSS.\n\n1. **Update ACF Color Picker Options (optional):**\n\n   If you wish to have your new colors available as options within the Advanced\n   Custom Fields (ACF) Color Picker, you'll need to edit the\n   `tailwind.bg-colors-safelist.json` file.\n\n   The contents of this file are automatically included in the Tailwind CSS\n   safelist to ensure that your custom colors are available for use in\n   Tailwind's utility classes. Additionally, these colors are utilized by [the\n   ACF\n   class](https://github.com/somoscuatro/sc-starter-theme/blob/main/src/class-acf.php)\n   to populate the color picker options within the WordPress admin.\n\nBy customizing these JSON files, you can easily extend the theme's color palette\nand ensure that your chosen colors are readily available for both your Tailwind\nCSS classes and the ACF Color Picker.\n\n## How to Create Gutenberg Blocks\n\nTo create a new Gutenberg Block using our ACF based implementation, follow the\nsteps outlined below:\n\n1. **Initialize a New Block Directory:**\n\n   Begin by creating a new folder within the `src/blocks` directory. Name it to\n   reflect your block's purpose, such as `my-beautiful-block`.\n\n1. **Create the ACF `block.json` File:**\n\n   The `block.json` file serves as the cornerstone for defining a Gutenberg\n   block's metadata. It provides essential details about the block, such as its\n   name, icon, category, and other characteristics. To gain a comprehensive\n   understanding of the `block.json` structure and its role in block creation,\n   consult [the WordPress Developer Resources page on\n   block.json](https://developer.wordpress.org/block-editor/getting-started/fundamentals/block-json/).\n\n   A critical attribute within `block.json` is the `renderCallback`. This\n   attribute should be set to reference the PHP class responsible for rendering\n   the block (see step 3 below).\n\n   Check [the block.json of the sample\n   block](https://github.com/somoscuatro/sc-starter-theme/blob/main/src/blocks/sample/block.json)\n   included in the theme for guidance.\n\n   Please be aware that when naming your block, it is essential to use the\n   prefix `acf/` to ensure that Advanced Custom Fields correctly recognizes and\n   interprets your block. For example, if your block is named\n   `my-beautiful-block`, the full name in the `block.json` should be\n   `acf/my-beautiful-block`.\n\n1. **Create the Block's Main Class:**\n\n   For our given example, you would create a PHP file named\n   `class-my-beautiful-block.php`. This file should define a class named\n   `My_Beautiful_Block`. This class acts as the foundation for your block's\n   functionality. It must include the `get_acf_fields` method, which is\n   responsible for specifying the ACF fields that will appear in the WordPress\n   admin interface for your block.\n\n   Check [the class-sample.php of the sample\n   block](https://github.com/somoscuatro/sc-starter-theme/blob/main/src/blocks/sample/class-sample.php)\n   included in the theme for guidance.\n\n   You can use the ACF interface to design your custom fields group, and when\n   ready, export it as PHP code directly from the _ACF_ \u003e _Tools_ section in\n   your WordPress dashboard. After exporting, integrate the PHP code into the\n   `get_acf_fields` method of your custom block or theme functions.\n\n   Remember to deactivate or delete the original field group in the ACF\n   interface. This will prevent the possibility of duplicate fields appearing\n   and ensures that your fields are managed solely through code.\n\n   For detailed guidance on registering your fields through PHP, read [this ACF\n   documentation\n   page](https://www.advancedcustomfields.com/resources/register-fields-via-php/).\n\n1. **Create the Block's Template:**\n\n   Create your block's layout by creating a file named `template.twig`. As for\n   any other template in the theme, you can utilize Twig and Tailwind CSS in\n   block templates.\n\n   Within this template, you can access the ACF fields directly without the need\n   to include the block prefix. For instance, if you have a field defined with\n   the key `field_block_my_beautiful_block_heading`, it will be accessible in\n   the Twig template simply as `heading` (i.e. `\u003cp\u003e{{ heading }}\u003c/p\u003e`).\n\nTo have a complete example of what explained above, have a look to [the sample\nblock included with the\ntheme](https://github.com/somoscuatro/sc-starter-theme/tree/main/src/blocks/sample).\n\n### Include Block's Assets\n\nYour block may need to include frontend assets.\n\nTo register these assets, implement a `register_assets` method within your block\nclass. This method will handle the registration of any scripts or styles your\nblock needs.\n\nFor instance, if you want to include Alpine.js, your method would look like\nthis:\n\n```php\npublic function register_assets(): void {\n  wp_register_script(\n    'alpine',\n    'https://unpkg.com/alpinejs@3.5.0/dist/cdn.min.js',\n    array(),\n    '3.5.0',\n    array(\n      'footer'   =\u003e false,\n      'strategy' =\u003e 'defer',\n    )\n  );\n}\n```\n\nYou should enqueue your block asets them within it's `template.twig` file. Use the\nTwig function `enqueue_script` to do so. For example, to enqueue Alpine.js for\nyour block you would write: `{{ enqueue_script('alpine') }}`.\n\nBy enqueuing the script in the template file, you guarantee that it's only\nloaded when the block is actually being used, optimizing your site's\nperformance.\n\n### Override Context\n\nIn certain scenarios, you might find it necessary to augment or modify the\nglobal context of your block with additional data or to alter the information\nprovided by Advanced Custom Fields (ACF).\n\nTo achieve this, you should define a method within your block class and\n[register it with filter](#wordpress-hooks-usage)\n`{theme_prefix}_block_context`, where `{theme_prefix}` is the machine name of\nyour theme. This method will be responsible for receiving and processing the\nblock's context along with any other settings from ACF. Here's a basic outline\nof how you can implement this method:\n\n```php\n#[Filter('my_beautiful_theme_block_context', accepted_args:2)]\npublic static function set_custom_context( array $context, array $block ): array {\n  // Ensure we modify context just for this specific block.\n  if ( 'acf/my-beautiful-block' !== $block['name'] ) {\n    return $context;\n  }\n\n  // Manipulate the block context as you wish here.\n\n  // Return the updated context.\n  return $context;\n}\n```\n\n### Export ACF Block Fields JSON\n\nThe theme includes a custom WP CLI command, `export-acf-blocks-fields`, which\nallows you to export the field definitions for ACF Blocks into a JSON file. This\ncommand is particularly useful for backing up your fields.\n\nTo learn more about the command's options and how to use it effectively, simply\nrun `wp export-acf-blocks-fields --help` in your terminal.\n\nOnce you have the generated JSON file for your block field group, you can easily\nimport it into the ACF interface to make additional modifications. Navigate to\n_ACF_ \u003e _Tools_ \u003e _Import_ within your WordPress dashboard. From there, you can\nupload the JSON file, which will seamlessly integrate your field group back into\nthe ACF system. This allows you to adjust and refine your fields directly\nthrough the ACF interface with ease.\n\n## How to Add Custom Post Types\n\nTo introduce new Custom Post Types (CPTs) to your WordPress theme, you should\ncreate a dedicated class within the `src/custom-post-types/post-types`\ndirectory. Ensure that the class name reflects the CPT's purpose and is\nconsistent with its naming convention.\n\nWithin your CPT class, it's essential to define the singular and plural labels\nfor the CPT. Additionally, you may want to customize various attributes of your\nCPT, such as its admin dashboard icon, the features it supports (e.g., title,\neditor, thumbnails), and its visibility in the WordPress REST API, among others.\nThese customizations can be configured in the constructor of your CPT class. The\npossible arguments are those accepted by WordPress method `register_post_type`.\nSee [WordPress documentation for method\nregister_post_type](https://developer.wordpress.org/reference/functions/register_post_type/).\n\nThe theme includes [the implementation of a\nCPT](https://github.com/somoscuatro/sc-starter-theme/blob/main/src/custom-post-types/post-types/class-sample.php)\nnamed `Sample` you can use as reference.\n\n## How to Add Custom Taxonomies\n\nTo introduce new Custom Taxonomies to your WordPress theme, you should create a\ndedicated class within the `src/custom-taxonomies/taxonomies` directory. Ensure\nthat the class name reflects the taxonomy purpose and is consistent with its\nnaming convention.\n\nWithin your taxonomy class, it's essential to define the singular and plural\nlabels for the taxonomy. Additionally, you may want to customize various\nattributes of your taxonomy, such as its admin dashboard icon, the features it\nsupports (e.g., title, editor, thumbnails), and its visibility in the WordPress\nREST API, among others. These customizations can be configured in the\nconstructor of your taxonomy class. The possible arguments are those accepted by\nWordPress method `register_taxonomy`. See [WordPress documentation for method\nregister_post_type](https://developer.wordpress.org/reference/functions/register_taxonomy/).\n\nThe theme includes [the implementation of a\ntaxonomy](https://github.com/somoscuatro/sc-starter-theme/blob/main/src/custom-taxonomies/taxonomies/class-sample-category.php)\nnamed `Sample` you can use as reference.\n\n## Translations\n\nTranslations file are stored in the `languages` folder.\n\nTo create the necessary .po/.mo files for your theme's supported languages, we\nrecommend using a tool like [POEdit](https://poedit.net/).\n\nThis theme includes translations for Catalan, Italian and Spanish.\n\n## Performance Improvements\n\nThis theme applies several improvements to ensure top performance, implemented\nin `src/class-performance.php`:\n\n- [Possibility of preloading\n  assets](https://github.com/somoscuatro/sc-starter-theme/blob/44b164f1d500e48760bc9a10a546016bf8bb8e1a/src/class-performance.php#L57C2-L63C3).\n  To use it, simply add a `-preload` suffix to your assets handle name. For\n  example:\n\n  ```php\n  wp_enqueue_style( 'sc-starter-theme-fonts-preload', $this-\u003eget_base_url() . '/dist/styles/fonts.css', false, $this-\u003eget_filemtime( 'styles/fonts.css' ) );\n  ```\n\n- [Remove non-essential WordPress default\n  assets](https://github.com/somoscuatro/sc-starter-theme/blob/44b164f1d500e48760bc9a10a546016bf8bb8e1a/src/class-performance.php#L24-L45)\n- [Possibility of removing unused WordPress default\n  blocks](https://github.com/somoscuatro/sc-starter-theme/blob/44b164f1d500e48760bc9a10a546016bf8bb8e1a/src/class-gutenberg.php#L51C2-L63C1)\n- Selective enqueueing of custom blocks assets, as explained in section [Include\n  Block's Assets](#include-blocks-assets).\n\n## Code Standards\n\nOur code standards adhere to the guidelines established by the WordPress\ncommunity. To ensure these standards are consistently applied, we utilize a\nsuite of code quality tools:\n\n- [PHPCS (PHP CodeSniffer)](https://github.com/squizlabs/PHP_CodeSniffer)\n- [ESLint](https://eslint.org/)\n- [Stylelint](https://stylelint.io/)\n- [Prettier](https://prettier.io/)\n\nAdditionally, we use [PHPStan](https://phpstan.org/) for static analysis,\nwhich significantly improves our code quality by detecting bugs and potential\nissues before runtime.\n\n## Automated Deployment\n\nThis theme features a `pnpm run deploy` command that automates version bumping,\ncode pushing to GitHub, and release creation with the specified project version.\nEnsure you have the [GitHub CLI](https://cli.github.com/) installed to utilize\nthis functionality.\n\nIf your WordPress site is on WP Engine, you may consider using our GitHub Action\nfor automated deployments:\n[action-deploy-to-wpengine](https://github.com/somoscuatro/action-deploy-to-wpengine)\n\n## How to Contribute\n\nAny kind of contribution is very welcome!\n\nPlease, be sure to read our Code of Conduct.\n\nIf you notice something wrong please open an issue or create a Pull Request or\njust send an email to [tech@somoscuatro.es](mailto:tech@somoscuatro.es). If you\nwant to warn us about an important security vulnerability, please read our\nSecurity Policy.\n\n## License\n\nAll code is released under MIT license version. For more information, please\nrefer to\n[LICENSE.md](https://github.com/somoscuatro/sc-starter-theme/blob/main/LICENSE.md)\nfile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomoscuatro%2Fsc-starter-theme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomoscuatro%2Fsc-starter-theme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomoscuatro%2Fsc-starter-theme/lists"}