Skip to content

Commit

Permalink
Added composer.jsonMoved uikit to vendor folder. Added Carbon Fields.…
Browse files Browse the repository at this point in the history
… Updated installation notes in README.md. Deleted lib folder.
  • Loading branch information
apzeero committed May 28, 2019
1 parent 38f5030 commit 439f8dd
Show file tree
Hide file tree
Showing 8 changed files with 303 additions and 16 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ After WordPress setup follow these steps:
1. Install plugin: [Query Monitor](https://wordpress.org/plugins/query-monitor/) by Jogn Blackbourn
2. Install test data: [WP Test](https://github.com/poststatus/wptest#installation)

## Installation
## Theme Installation and Setup
1. Clone inside theme folder: /wp-content/themes
```git clone --recursive https://github.com/wpugph/themewpugph.git```
2. Compile stylesheet site.scs
3. Activate the theme
2. Install dependencies
```composer install```
3. Compile stylesheet site.scss
4. Activate the theme

## Dependecies
- [UIKit 3](https://github.com/uikit/uikit) - A lightweight and modular front-end framework for developing fast and powerful web interfaces
- [Carbon Fields ](https://github.com/htmlburger/carbon-fields) - A developer-oriented library for WordPress custom fields for all types of WordPress content.

## Roadmap ([See v1](https://github.com/wpugph/gutenberg-starter-theme/projects/1))
- Integrate UIKit 3
- Basic Gutenblocks for UIkit components
- Basic Gutenblocks for UIKit 3 components
- WP UIkit Customizer
- A11y ready

Expand Down
13 changes: 13 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"require": {
"squizlabs/php_codesniffer": "*",
"htmlburger/carbon-fields": "^3.1",
"uikit/uikit": "^3.1"
},
"scripts": {
"install-wpcs": [
"composer create-project wp-coding-standards/wpcs --no-dev",
"./vendor/bin/phpcs --config-set installed_paths ./wpcs"
]
}
}
230 changes: 230 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
* @package ThemeWPUGPH
*/

$org_name = get_option( 'themewpugph_org_name', '' );
$org_year = get_option( 'themewpugph_org_year', '' );

$org_name = carbon_get_theme_option( 'themewpugph_org_name', '' );
$org_year = carbon_get_theme_option( 'themewpugph_org_year', '' );
?>
</div>
</main>
Expand Down
24 changes: 19 additions & 5 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@
* @package ThemeWPUGPH
*/

use Carbon_Fields\Container;
use Carbon_Fields\Field;

/**
* Autoload Carbon Fields.
*
* @return void
*/
function crb_load() {
require_once get_template_directory() . '/vendor/autoload.php';
\Carbon_Fields\Carbon_Fields::boot();
}
add_action( 'after_setup_theme', 'crb_load' );

require get_template_directory() . '/inc/defines.php';
require get_template_directory() . '/inc/class-themewpugph-add-settings-field.php';
require get_template_directory() . '/inc/theme-options.php';

if ( ! function_exists( 'themewpugph_setup' ) ) :
/**
Expand Down Expand Up @@ -185,14 +199,14 @@ function themewpugph_scripts() {
if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) {

$mainstyles = '/site.css';
$uikitjs = '/lib/uikit/dist/js/uikit.js';
$uikiticonsjs = '/lib/uikit/dist/js/uikit-icons.js';
$uikitjs = '/vendor/uikit/uikit/dist/js/uikit.js';
$uikiticonsjs = '/vendor/uikit/uikit/dist/js/uikit-icons.js';

} else {

$mainstyles = '/site.min.css';
$uikitjs = '/lib/uikit/dist/js/uikit.min.js';
$uikiticonsjs = '/lib/uikit/dist/js/uikit-icons.min.js';
$uikitjs = '/vendor/uikit/uikit/dist/js/uikit.min.js';
$uikiticonsjs = '/vendor/uikit/uikit/dist/js/uikit-icons.min.js';

}

Expand Down
29 changes: 29 additions & 0 deletions inc/theme-options.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* Add Theme optiions using Carbon Fields.
*
* @link https://github.com/htmlburger/carbon-fields-docs/tree/master/documentation
*
* @package ThemeWPUGPH
*/

use Carbon_Fields\Container;
use Carbon_Fields\Field;

/**
* Add options used in theme.
*
* @return void
*/
function themewpugph_options() {
Container::make( 'theme_options', __( 'Theme Options', 'themewpugph' ) )
->add_fields(
array(
Field::make( 'text', 'themewpugph_org_name', 'Organization Name' ),
Field::make( 'date', 'themewpugph_org_year', 'Year of Foundation' )
->set_input_format( 'Y', 'Y' )
->set_storage_format( 'Y' ),
)
);
}
add_action( 'carbon_fields_register_fields', 'themewpugph_options' );
1 change: 0 additions & 1 deletion lib/uikit
Submodule uikit deleted from 109a9b

0 comments on commit 439f8dd

Please sign in to comment.