Download the PHP package nikitaglobal/wptheme without Composer
On this page you can find all versions of the php package nikitaglobal/wptheme. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package wptheme
nikita.global 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.
Basic installation
- In installed and working wordpress create your theme folder in wp-content/themes.
- Run "composer require nikitaglobal/wptheme" in it.
- Run "sh vendor/nikitaglobal/wptheme/bin/mktheme" or copy vendor/mycooltheme/wptheme/toTheme files to your theme folder
- Rename theme.php.sample to theme.php and edit it.
theme.php
THEMEPREFIX is a basic constant. Can be almost any unique value of latin letters and numbers. Used for naming shortcodes, hooks, enqueuing styles and scripts. THEMEVERSION is current version of your theme. THEMESCRIPTS is an array of your js scripts used in theme. All paths are relative to your theme folder or absolute URI. THEMESTYLES same for your css. If style is prefixed with '@', it will be inlined. THEMEMENUS is an array of menu arrays, each menu is defined by id and label, see example below. TYPE_FIELDS is an array which defines custom fields for each post types. "plans" and "reviews" are in the given example below. The syntax is almost like here [https://docs.carbonfields.net/learn/fields/usage.html] SETTINGS_FIELDS is a similar array which defines basic theme settings. Like the contacts in header or footer. TEMPLATE_FIELDS is a similar array which defines custom fields for theme templates. Like price for product page.
Example:
Menus
Method Wptheme\Menu::items( 'topmenu' ) returns array of WP Objects for menu items for topmenu location. Also the object has extra keys:
- active true/false if this item is the current item
- domain stripped domainname. https://somedomain.com/category/postname turns to somedomain. One of the application is obtainig popular service names, like youtube, instagram
- children array of child menu items with the same structure as parent items
Example:
Tags
For single post
NgTheme::tags()
All tags
NgTheme::get_all_tags()