PHPackages                             nikitaglobal/wptheme - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. nikitaglobal/wptheme

ActiveProject

nikitaglobal/wptheme
====================

Basic theme v.2.0

2.22(5mo ago)099MITPHPPHP &gt;=5.3.0

Since Dec 12Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/nikitaGlobal/wptheme)[ Packagist](https://packagist.org/packages/nikitaglobal/wptheme)[ RSS](/packages/nikitaglobal-wptheme/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (23)Used By (0)

nikita.global WP theme
======================

[](#nikitaglobal-wp-theme)

This package is to make WordPress theme development easier. I have created it for my needs, but it might be useful for you too.

**Features:**

- WordPress Coding Standards compliant
- Carbon Fields integration for custom fields
- Automatic menu handling with nested items support
- Automatic hooks, filters, and shortcodes registration
- Social sharing functionality
- PSR-4 autoloading support

Basic installation
------------------

[](#basic-installation)

1. In installed and working WordPress create your theme folder in `wp-content/themes`.
2. Run `composer require nikitaglobal/wptheme` in it.
3. Run `sh vendor/nikitaglobal/wptheme/bin/mktheme` or copy `vendor/nikitaglobal/wptheme/toTheme` files to your theme folder.
4. Rename `theme.php.sample` to `theme.php` and edit it.

theme.php Configuration
-----------------------

[](#themephp-configuration)

The `theme.php` file contains all theme configuration constants:

- **THEMEPREFIX** - Basic constant. Can be almost any unique value of latin letters and numbers. Used for naming shortcodes, hooks, enqueuing styles and scripts.
- **THEMEVERSION** - Current version of your theme.
- **THEMESCRIPTS** - Array of your JavaScript scripts used in theme. All paths are relative to your theme folder or absolute URI.
- **THEMESTYLES** - Array of your CSS files. If style is prefixed with `@`, it will be inlined.
- **THEMEMENUS** - Array of menu arrays, each menu is defined by `id` and `label`, see example below.
- **TYPE\_FIELDS** - Array which defines custom fields for each post type. "plans" and "reviews" are in the given example below. The syntax is almost like [Carbon Fields documentation](https://docs.carbonfields.net/learn/fields/usage.html).
- **SETTINGS\_FIELDS** - Array which defines basic theme settings. Like the contacts in header or footer.
- **TEMPLATE\_FIELDS** - Array which defines custom fields for theme templates. Like price for product page.

Example:

```
