Skip to content

Commit

Permalink
Merge pull request #27 from seothemes/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
seothemes committed Oct 9, 2018
2 parents 64d2b44 + ee91688 commit 39d7ce6
Show file tree
Hide file tree
Showing 53 changed files with 11,907 additions and 173 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Expand Up @@ -12,11 +12,6 @@ vendor
package-lock.json
composer.lock

# Ignore generated stylesheets
style.css
style.css.map
woocommerce.css

# Ignore editor files.
.idea

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,12 @@
# Genesis Starter Theme Changelog

## [3.3.3] - 2018-10-10
* Add front page template and widget areas
* Add full width and landing page templates
* Add default hero image
* Add generated stylesheets to version control
* Update Sass file structure

## [3.3.2] - 2018-10-05
* Add featured image display setting for single posts
* Fix text domains in config
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -2,7 +2,7 @@

[![WordPress](https://img.shields.io/badge/wordpress-4.9.8%20tested-brightgreen.svg)]() [![License](https://img.shields.io/badge/license-GPL--3.0--or--later-blue.svg)](https://github.com/seothemes/genesis-starter-theme/blob/master/LICENSE.md)

This is a developer-friendly starter theme used for creating commercial child themes for the Genesis Framework.
A developer-friendly starter theme used for creating commercial child themes for the Genesis Framework.

It uses Composer to pull in the [Core](https://github.com/seothemes/core) component library which provides the PHP logic for the theme's configuration, and it uses [Gulp WP Toolkit](https://github.com/craigsimps/gulp-wp-toolkit) to automate mundane build tasks like compiling SCSS and minifying images.

Expand Down Expand Up @@ -126,7 +126,6 @@ your-theme-name/ # → Root directory
├── config/ # → Config directory
│ └── config.php # → Theme settings
├── resources/ # → Front-end assets
│ ├── demo/ # → Theme demo files
│ ├── fonts/ # → Theme fonts
│ ├── img/ # → Theme images
│ ├── js/ # → Theme JavaScript
Expand All @@ -137,6 +136,7 @@ your-theme-name/ # → Root directory
├── vendor/ # → Composer packages
├── composer.json # → Composer settings
├── functions.php # → Composer autoloader
├── front-page.php # → Front page template
├── Gulpfile.js # → Gulp config
├── package.json # → Node dependencies
├── screenshot.png # → Theme screenshot
Expand Down
169 changes: 146 additions & 23 deletions config/defaults.php
Expand Up @@ -17,9 +17,11 @@
use SeoThemes\Core\Customizer;
use SeoThemes\Core\GenesisSettings;
use SeoThemes\Core\GoogleFonts;
use SeoThemes\Core\HeroSection;
use SeoThemes\Core\Hooks;
use SeoThemes\Core\ImageSizes;
use SeoThemes\Core\PageLayouts;
use SeoThemes\Core\PageTemplate;
use SeoThemes\Core\PluginActivation;
use SeoThemes\Core\PostTypeSupport;
use SeoThemes\Core\SimpleSocialIcons;
Expand Down Expand Up @@ -69,6 +71,17 @@
AssetLoader::ENQUEUE => true,
],
],
AssetLoader::STYLES => [
[
AssetLoader::HANDLE => 'woocommerce',
AssetLoader::URL => AssetLoader::path( '/woocommerce.css' ),
AssetLoader::VERSION => wp_get_theme()->get( 'Version' ),
AssetLoader::ENQUEUE => true,
AssetLoader::CONDITIONAL => function () {
return class_exists( 'WooCommerce' );
},
],
],
];

$core_constants = [
Expand Down Expand Up @@ -192,19 +205,42 @@
],
];

$core_hero_section = [
HeroSection::ENABLE => [
HeroSection::PAGE => true,
HeroSection::POST => true,
HeroSection::PRODUCT => true,
HeroSection::PORTFOLIO_ITEM => true,
HeroSection::FRONT_PAGE => true,
HeroSection::ATTACHMENT => true,
HeroSection::ERROR_404 => true,
HeroSection::LANDING_PAGE => false,
HeroSection::BLOG_TEMPLATE => true,
HeroSection::SEARCH => true,
HeroSection::AUTHOR => true,
HeroSection::DATE => true,
HeroSection::LATEST_POSTS => true,
HeroSection::BLOG => true,
HeroSection::SHOP => true,
HeroSection::PORTFOLIO => true,
HeroSection::PORTFOLIO_TYPE => true,
HeroSection::PRODUCT_ARCHIVE => true,
HeroSection::CATEGORY => true,
HeroSection::TAG => true,
],
];

$core_hooks = [
Hooks::ADD => [
[
Hooks::TAG => 'genesis_doctype',
Hooks::CALLBACK => function () {
ob_start();
genesis_html5_doctype();
$markup = ob_get_clean();
echo str_replace( '<html', '<html class="admin-bar-showing" ', $markup );
},
Hooks::CONDITIONAL => function () {
return is_admin_bar_showing();
},
Hooks::TAG => 'template_include',
Hooks::CALLBACK => function ( $template ) {
if ( ! is_front_page() || 'posts' === get_option( 'show_on_front' ) ) {
return $template;
}

return get_stylesheet_directory() . '/resources/views/page-front.php';
}
],
[
Hooks::TAG => 'wp_enqueue_scripts',
Expand All @@ -214,14 +250,26 @@
[
Hooks::TAG => 'body_class',
Hooks::CALLBACK => function ( $classes ) {
if ( is_home() || is_search() || is_author() || is_date() || is_category() || is_tag() || is_page_template( 'page_blog.php' ) ) {
$classes[] = 'post-grid';
if ( ! is_front_page() && is_home() || is_search() || is_author() || is_date() || is_category() || is_tag() || is_page_template( 'page_blog.php' ) ) {
$classes[] = 'is-archive';
}

if ( ! is_front_page() && ! is_page_template( 'page_blog.php' ) && ! is_post_type_archive() && is_singular() || is_404() ) {
$classes[] = 'is-singular';
}

if ( is_page_template( 'page-blog.php' ) ) {
$classes[] = 'blog';
$classes = array_diff( $classes, [ 'page' ] );
}

if ( is_front_page() ) {
$classes[] = 'front-page';
}

$classes[] = 'no-js';

return $classes;

},
],
[
Expand Down Expand Up @@ -316,6 +364,19 @@
add_editor_style( 'editor.css' );
},
],
[
Hooks::TAG => 'genesis_setup',
Hooks::CALLBACK => function () {
register_default_headers( [
'child' => [
'url' => '%2$s/resources/img/hero.jpg',
'thumbnail_url' => '%2$s/resources/img/hero.jpg',
'description' => __( 'Hero Image', 'corporate-pro' ),
],
] );
},
Hooks::PRIORITY => 20,
],
[
Hooks::TAG => 'genesis_entry_content',
Hooks::CALLBACK => function () {
Expand All @@ -339,6 +400,18 @@
Hooks::TAG => 'child_theme_before_footer_wrap',
Hooks::CALLBACK => 'genesis_footer_widget_areas',
],
[
Hooks::TAG => 'genesis_widget_column_classes',
Hooks::CALLBACK => function ( $column_classes ) {
$column_classes[] = 'one-fifth';
$column_classes[] = 'two-fifths';
$column_classes[] = 'three-fifths';
$column_classes[] = 'four-fifths';
$column_classes[] = 'full-width';

return $column_classes;
},
],
],
Hooks::REMOVE => [
[
Expand Down Expand Up @@ -400,6 +473,13 @@
],
];

$core_page_templates = [
PageTemplate::REGISTER => [
'/resources/views/page-full.php' => 'Full Width',
'/resources/views/page-landing.php' => 'Landing Page',
],
];

$core_plugins = [
PluginActivation::REGISTER => [
[
Expand Down Expand Up @@ -468,15 +548,19 @@
],
],
'custom-header' => [
'header-selector' => '.hero-section',
'default_image' => get_stylesheet_directory_uri() . '/resources/img/hero.jpg',
'header-text' => false,
'width' => 1280,
'height' => 720,
'flex-height' => true,
'flex-width' => true,
'uploads' => true,
'video' => true,
'header-selector' => '.hero-section',
'default_image' => get_stylesheet_directory_uri() . '/resources/img/hero.jpg',
'header-text' => false,
'width' => 1280,
'height' => 720,
'flex-height' => true,
'flex-width' => true,
'uploads' => true,
'video' => true,
'wp-head-callback' => [
'SeoThemes\Core\HeroSection',
'custom_header',
],
],
'genesis-accessibility' => [
'404-page',
Expand Down Expand Up @@ -519,8 +603,45 @@
];

$core_widget_areas = [
WidgetArea::REGISTER => [
[
WidgetArea::ID => 'front-page-1',
WidgetArea::NAME => __( 'Front Page 1', 'genesis-starter-theme' ),
WidgetArea::DESCRIPTION => __( 'Front Page 1 widget area.', 'genesis-starter-theme' ),
WidgetArea::LOCATION => 'genesis_loop',
WidgetArea::BEFORE_TITLE => '<h1 itemprop="headline">',
WidgetArea::AFTER_TITLE => '</h1>',
WidgetArea::BEFORE => function () {
ob_start();
the_custom_header_markup();
$custom_header = ob_get_clean();

return '<div class="front-page-1 widget-area">' . $custom_header . '<div class="wrap">';
},
WidgetArea::CONDITIONAL => function () {
return is_front_page();
},
],
[
WidgetArea::ID => 'front-page-2',
WidgetArea::NAME => __( 'Front Page 2', 'genesis-starter-theme' ),
WidgetArea::DESCRIPTION => __( 'Front Page 2 widget area.', 'genesis-starter-theme' ),
WidgetArea::LOCATION => 'genesis_loop',
WidgetArea::CONDITIONAL => function () {
return is_front_page();
},
],
[
WidgetArea::ID => 'front-page-3',
WidgetArea::NAME => __( 'Front Page 3', 'genesis-starter-theme' ),
WidgetArea::DESCRIPTION => __( 'Front Page 3 widget area.', 'genesis-starter-theme' ),
WidgetArea::LOCATION => 'genesis_loop',
WidgetArea::CONDITIONAL => function () {
return is_front_page();
},
],
],
WidgetArea::UNREGISTER => [
WidgetArea::HEADER_RIGHT,
WidgetArea::SIDEBAR_ALT,
],
];
Expand All @@ -533,9 +654,11 @@
Example::class => $core_example,
GenesisSettings::class => $core_genesis_settings,
GoogleFonts::class => $core_google_fonts,
HeroSection::class => $core_hero_section,
Hooks::class => $core_hooks,
ImageSizes::class => $core_image_sizes,
PageLayouts::class => $core_layouts,
PageTemplate::class => $core_page_templates,
PluginActivation::class => $core_plugins,
PostTypeSupport::class => $core_post_type_support,
SimpleSocialIcons::class => $core_simple_social_icons,
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "genesis-starter-theme",
"version": "3.3.2",
"version": "3.3.3",
"description": "Genesis starter theme with a modern development workflow.",
"repository": {
"type": "git",
Expand Down
Binary file added resources/img/hero.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 35 additions & 11 deletions resources/lang/genesis-starter-theme.pot
@@ -1,8 +1,8 @@
# Copyright (C) 2018 Genesis Starter Theme 3.3.2
# This file is distributed under the same license as the Genesis Starter Theme 3.3.2 package.
# Copyright (C) 2018 Genesis Starter Theme 3.3.3
# This file is distributed under the same license as the Genesis Starter Theme 3.3.3 package.
msgid ""
msgstr ""
"Project-Id-Version: Genesis Starter Theme 3.3.2\n"
"Project-Id-Version: Genesis Starter Theme 3.3.3\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -13,34 +13,58 @@ msgstr ""
"X-Poedit-SourceCharset: UTF-8\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: config/defaults.php:42
#: config/defaults.php:44
msgid "Menu"
msgstr ""

#: config/defaults.php:43
#: config/defaults.php:45
msgid "Sub Menu"
msgstr ""

#: config/defaults.php:90
#: config/defaults.php:103
msgid "Single Posts"
msgstr ""

#: config/defaults.php:98
#: config/defaults.php:111
msgid "Display featured image?"
msgstr ""

#: config/defaults.php:296
#: config/defaults.php:344
msgid "Return to top"
msgstr ""

#: config/defaults.php:389
#: config/defaults.php:462
msgid "Center Content"
msgstr ""

#: config/defaults.php:492
#: config/defaults.php:576
msgid "Header Menu"
msgstr ""

#: config/defaults.php:493
#: config/defaults.php:577
msgid "After Header Menu"
msgstr ""

#: config/defaults.php:609
msgid "Front Page 1"
msgstr ""

#: config/defaults.php:610
msgid "Front Page 1 widget area."
msgstr ""

#: config/defaults.php:627
msgid "Front Page 2"
msgstr ""

#: config/defaults.php:628
msgid "Front Page 2 widget area."
msgstr ""

#: config/defaults.php:636
msgid "Front Page 3"
msgstr ""

#: config/defaults.php:637
msgid "Front Page 3 widget area."
msgstr ""

0 comments on commit 39d7ce6

Please sign in to comment.