diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..58065a82 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,22 @@ +version: 2.1 +jobs: + standards: + docker: + - image: circleci/php:7.3.3-stretch-node-browsers + steps: + - checkout + - install-dependencies + - run: composer phpcs + - run: npm run lint:css + - run: npm run lint:js +commands: + install-dependencies: + description: "Install development dependencies." + steps: + - run: composer install + - run: npm ci +workflows: + version: 2 + check-standards: + jobs: + - standards diff --git a/.gitignore b/.gitignore index 1b3566d0..f6dbd9c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store /composer.lock /phpcs.xml node_modules/ diff --git a/.scripts/makezip.js b/.scripts/makezip.js index 015af8cf..38acd9e4 100644 --- a/.scripts/makezip.js +++ b/.scripts/makezip.js @@ -16,6 +16,7 @@ const recursive = require("recursive-readdir"); const prettyBytes = require("pretty-bytes"); const excludes = [ + ".circleci", ".DS_Store", ".editorconfig", ".eslintignore", @@ -37,8 +38,11 @@ const excludes = [ ]; // Creates a file to stream archive data to. -// Uses the name in package.json, such as 'child-theme.zip'. -let output = fs.createWriteStream(`${process.env.npm_package_name}.zip`); +// Uses the name in package.json, such as 'child-theme.1.1.0.zip'. +let fileName = `${process.env.npm_package_name}.${ + process.env.npm_package_theme_version +}.zip`; +let output = fs.createWriteStream(fileName); let archive = archiver("zip", { zlib: { level: 9 } // Best compression. @@ -52,9 +56,7 @@ const setupZipArchive = function() { // Report the zip name and size, and rename *.txt files back to *.md again. output.on("close", function() { let fileSize = prettyBytes(archive.pointer()); - console.log( - chalk`{cyan Created ${process.env.npm_package_name}.zip, ${fileSize}}` - ); + console.log(chalk`{cyan Created ${fileName}, ${fileSize}}`); renameTxtFilesToMarkdown(); }); diff --git a/CHANGELOG.md b/CHANGELOG.md index 56731967..5198c3d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Genesis Sample Theme Changelog +## [3.1.0] - 2019-08-21 +Requires Genesis 3.1.0+ + +### Added +* Starter Pack feature to allow imported content choices. +* Customizer Logo width validation and messaging. +* Featured image display options for singular posts and pages. +* Footer widget import with one-click theme setup. + +### Changed +* Updated Screenshot to reflect one-click theme setup content. +* Set archive image size to genesis-singular-images on theme activation. +* Allow breadcrumbs and layout settings to be used on the landing page template. +* Use `genesis-custom-logo` functionality in place of `custom-logo`. +* Use PHP short array syntax. +* Update one-click theme setup content page meta to accommodate new Genesis 3.1 features. +* Add version number to zip files generated with `npm run zip`. ([GitHub version](https://github.com/studiopress/genesis-sample/) only.) +* Update the phpcs config to include a PHP short array rule and update PHP and WordPress testing versions. ([GitHub version](https://github.com/studiopress/genesis-sample/) only.) +* Update developer dependencies. ([GitHub version](https://github.com/studiopress/genesis-sample/) only.) +* Simplified `genesis_sample_secondary_menu_args` function. + +### Removed +* Block page template in favor of new Genesis per-page settings. + ## [3.0.1] - 2019-06-25 * Use current theme name instead of 'genesis-sample' when enqueueing assets. This ensures assets continue to load if the theme is renamed. diff --git a/config/appearance.php b/config/appearance.php index 570c9bbe..95ae832d 100644 --- a/config/appearance.php +++ b/config/appearance.php @@ -8,10 +8,10 @@ * @link https://www.studiopress.com/ */ -$genesis_sample_default_colors = array( +$genesis_sample_default_colors = [ 'link' => '#0073e5', 'accent' => '#0073e5', -); +]; $genesis_sample_link_color = get_theme_mod( 'genesis_sample_link_color', @@ -26,7 +26,7 @@ $genesis_sample_link_color_contrast = genesis_sample_color_contrast( $genesis_sample_link_color ); $genesis_sample_link_color_brightness = genesis_sample_color_brightness( $genesis_sample_link_color, 35 ); -return array( +return [ 'fonts-url' => 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,700&display=swap', 'content-width' => 1062, 'button-bg' => $genesis_sample_link_color, @@ -34,38 +34,38 @@ 'button-outline-hover' => $genesis_sample_link_color_brightness, 'link-color' => $genesis_sample_link_color, 'default-colors' => $genesis_sample_default_colors, - 'editor-color-palette' => array( - array( + 'editor-color-palette' => [ + [ 'name' => __( 'Custom color', 'genesis-sample' ), // Called “Link Color” in the Customizer options. Renamed because “Link Color” implies it can only be used for links. 'slug' => 'theme-primary', 'color' => $genesis_sample_link_color, - ), - array( + ], + [ 'name' => __( 'Accent color', 'genesis-sample' ), 'slug' => 'theme-secondary', 'color' => $genesis_sample_accent_color, - ), - ), - 'editor-font-sizes' => array( - array( + ], + ], + 'editor-font-sizes' => [ + [ 'name' => __( 'Small', 'genesis-sample' ), 'size' => 12, 'slug' => 'small', - ), - array( + ], + [ 'name' => __( 'Normal', 'genesis-sample' ), 'size' => 18, 'slug' => 'normal', - ), - array( + ], + [ 'name' => __( 'Large', 'genesis-sample' ), 'size' => 20, 'slug' => 'large', - ), - array( + ], + [ 'name' => __( 'Larger', 'genesis-sample' ), 'size' => 24, 'slug' => 'larger', - ), - ), -); + ], + ], +]; diff --git a/config/child-theme-settings.php b/config/child-theme-settings.php index 7b9ae750..a036f55b 100644 --- a/config/child-theme-settings.php +++ b/config/child-theme-settings.php @@ -10,8 +10,8 @@ * @link https://www.studiopress.com/ */ -return array( - GENESIS_SETTINGS_FIELD => array( +return [ + GENESIS_SETTINGS_FIELD => [ 'blog_cat_num' => 6, 'breadcrumb_home' => 0, 'breadcrumb_front_page' => 0, @@ -24,10 +24,10 @@ 'content_archive' => 'full', 'content_archive_limit' => 0, 'content_archive_thumbnail' => 0, - 'image_size' => '', - 'image_alignment' => 'alignleft', + 'image_size' => 'genesis-singular-images', + 'image_alignment' => 'aligncenter', 'posts_nav' => 'numeric', 'site_layout' => 'content-sidebar', - ), + ], 'posts_per_page' => 6, -); +]; diff --git a/config/import/content/homepage.php b/config/import/content/home-black-white.php similarity index 98% rename from config/import/content/homepage.php rename to config/import/content/home-black-white.php index 7d5b0c2c..9269bf38 100644 --- a/config/import/content/homepage.php +++ b/config/import/content/home-black-white.php @@ -10,6 +10,7 @@ * @link https://www.studiopress.com/ */ +// Photo by Rohit Tandon on Unsplash: https://unsplash.com/photos/9wg5jCEPBsw. $genesis_sample_homepage_header_image_url = CHILD_URL . '/config/import/images/mountain-bw.jpg'; // Photo by Haley Powers on Unsplash: https://unsplash.com/photos/rjhvXX7JBPc. @@ -26,7 +27,7 @@ -
Learn More
+
Learn More
diff --git a/config/import/content/home-color.php b/config/import/content/home-color.php new file mode 100644 index 00000000..3888f25b --- /dev/null +++ b/config/import/content/home-color.php @@ -0,0 +1,127 @@ + +
+

We'll teach you how to build and grow an online business.

+ + + +

All the resources, training, and support you need to run your dream online business!

+ + + + + + +
+ + + +
+

Ready to take your next step?

Grow your audience and build a profitable online business.

+ + +
+ + + +

+ + + +

What people are saying

+ + + +

+ + + +
+
+

Your course helped me to grow my email list from 500 to over 10,000 subscribers—all within 3 months!

Jane

Food Blogger
+
+ + + +
+

I started using your email marketing technique and it helped me to make $5,000 more a month without any extra work!

Rob

Copywriter
+
+ + + +
+

I was skeptical but I found that your system had multiplied my revenue by 40% after just the first quarter!

Susan

Entrepreneur
+
+
+ + + +

+ + + +
+
+
+

Contact us today

+
+ + + + +
+
+ + + +

+ + + +
+
+
Can I phone or email you?
+

You can reach us on our contact page or by calling us at 1.123.456.7891

+
+ + + +
How long have you been in business?
+

Our team has a combined experience of over 60 years.

+
+ + + +
What is your return policy?
+

We offer a 30-day return policy for all unused items. For more information, please view our terms of service.

+
+
+ + + +
+
Photo by Haley Powers on Unsplash
+
+
+ +CONTENT; diff --git a/config/import/images/home-about-color.jpg b/config/import/images/home-about-color.jpg new file mode 100644 index 00000000..8afe3ea0 Binary files /dev/null and b/config/import/images/home-about-color.jpg differ diff --git a/config/import/images/mountain-color.jpg b/config/import/images/mountain-color.jpg new file mode 100644 index 00000000..bc5ee21c Binary files /dev/null and b/config/import/images/mountain-color.jpg differ diff --git a/config/import/images/thumbnails/home-black-white.jpg b/config/import/images/thumbnails/home-black-white.jpg new file mode 100644 index 00000000..46d9ec3c Binary files /dev/null and b/config/import/images/thumbnails/home-black-white.jpg differ diff --git a/config/import/images/thumbnails/home-color.jpg b/config/import/images/thumbnails/home-color.jpg new file mode 100644 index 00000000..c7880bd5 Binary files /dev/null and b/config/import/images/thumbnails/home-color.jpg differ diff --git a/config/onboarding-shared.php b/config/onboarding-shared.php new file mode 100644 index 00000000..d6db6f40 --- /dev/null +++ b/config/onboarding-shared.php @@ -0,0 +1,139 @@ + [ + [ + 'name' => __( 'Atomic Blocks', 'genesis-sample' ), + 'slug' => 'atomic-blocks/atomicblocks.php', + 'public_url' => 'https://atomicblocks.com/', + ], + [ + 'name' => __( 'Simple Social Icons', 'genesis-sample' ), + 'slug' => 'simple-social-icons/simple-social-icons.php', + 'public_url' => 'https://wordpress.org/plugins/simple-social-icons/', + ], + [ + 'name' => __( 'Genesis eNews Extended (Third Party)', 'genesis-sample' ), + 'slug' => 'genesis-enews-extended/plugin.php', + 'public_url' => 'https://wordpress.org/plugins/genesis-enews-extended/', + ], + [ + 'name' => __( 'WPForms Lite (Third Party)', 'genesis-sample' ), + 'slug' => 'wpforms-lite/wpforms.php', + 'public_url' => 'https://wordpress.org/plugins/wpforms-lite/', + ], + ], + 'content' => [ + 'blocks' => [ + 'post_title' => 'Block Content Examples', + 'post_content' => require dirname( __FILE__ ) . '/import/content/block-examples.php', + 'post_type' => 'page', + 'post_status' => 'publish', + 'comment_status' => 'closed', + 'ping_status' => 'closed', + 'meta_input' => [ '_genesis_layout' => 'full-width-content' ], + ], + 'about' => [ + 'post_title' => 'About Us', + 'post_content' => require dirname( __FILE__ ) . '/import/content/about.php', + 'post_type' => 'page', + 'post_status' => 'publish', + 'featured_image' => CHILD_URL . '/config/import/images/about.jpg', + 'comment_status' => 'closed', + 'ping_status' => 'closed', + 'meta_input' => [ + '_genesis_layout' => 'full-width-content', + '_genesis_hide_singular_image' => true, + ], + ], + 'contact' => [ + 'post_title' => 'Contact Us', + 'post_content' => require dirname( __FILE__ ) . '/import/content/contact.php', + 'post_type' => 'page', + 'post_status' => 'publish', + 'comment_status' => 'closed', + 'ping_status' => 'closed', + ], + 'landing' => [ + 'post_title' => 'Landing Page', + 'post_content' => require dirname( __FILE__ ) . '/import/content/landing-page.php', + 'post_type' => 'page', + 'post_status' => 'publish', + 'page_template' => 'page-templates/landing.php', + 'comment_status' => 'closed', + 'ping_status' => 'closed', + 'meta_input' => [ + '_genesis_layout' => 'full-width-content', + '_genesis_hide_breadcrumbs' => true, + '_genesis_hide_singular_image' => true, + ], + ], + ], + 'navigation_menus' => [ + 'primary' => [ + 'homepage' => [ + 'title' => 'Home', + ], + 'about' => [ + 'title' => 'About Us', + ], + 'contact' => [ + 'title' => 'Contact Us', + ], + 'blocks' => [ + 'title' => 'Block Examples', + ], + 'landing' => [ + 'title' => 'Landing Page', + ], + ], + ], + 'widgets' => [ + 'footer-1' => [ + [ + 'type' => 'text', + 'args' => [ + 'title' => 'Design', + 'text' => '

With an emphasis on typography, white space, and mobile-optimized design, your website will look absolutely breathtaking.

Learn more about design.

', + 'filter' => 1, + 'visual' => 1, + ], + ], + ], + 'footer-2' => [ + [ + 'type' => 'text', + 'args' => [ + 'title' => 'Content', + 'text' => '

Our team will teach you the art of writing audience-focused content that will help you achieve the success you truly deserve.

Learn more about content.

', + 'filter' => 1, + 'visual' => 1, + ], + ], + ], + 'footer-3' => [ + [ + 'type' => 'text', + 'args' => [ + 'title' => 'Strategy', + 'text' => '

We help creative entrepreneurs build their digital business by focusing on three key elements of a successful online platform.

Learn more about strategy.

', + 'filter' => 1, + 'visual' => 1, + ], + ], + ], + ], +]; diff --git a/config/onboarding.php b/config/onboarding.php index 020805a9..3f95b6df 100644 --- a/config/onboarding.php +++ b/config/onboarding.php @@ -10,95 +10,73 @@ * @link https://www.studiopress.com/ */ -return array( - 'dependencies' => array( - 'plugins' => array( - array( - 'name' => __( 'Atomic Blocks', 'genesis-sample' ), - 'slug' => 'atomic-blocks/atomicblocks.php', - 'public_url' => 'https://atomicblocks.com/', - ), - array( - 'name' => __( 'Simple Social Icons', 'genesis-sample' ), - 'slug' => 'simple-social-icons/simple-social-icons.php', - 'public_url' => 'https://wordpress.org/plugins/simple-social-icons/', - ), - array( - 'name' => __( 'Genesis eNews Extended (Third Party)', 'genesis-sample' ), - 'slug' => 'genesis-enews-extended/plugin.php', - 'public_url' => 'https://wordpress.org/plugins/genesis-enews-extended/', - ), - array( - 'name' => __( 'WPForms Lite (Third Party)', 'genesis-sample' ), - 'slug' => 'wpforms-lite/wpforms.php', - 'public_url' => 'https://wordpress.org/plugins/wpforms-lite/', - ), - ), - ), - 'content' => array( - 'homepage' => array( - 'post_title' => 'Homepage', - 'post_content' => require dirname( __FILE__ ) . '/import/content/homepage.php', - 'post_type' => 'page', - 'post_status' => 'publish', - 'page_template' => 'page-templates/blocks.php', - 'comment_status' => 'closed', - 'ping_status' => 'closed', - ), - 'blocks' => array( - 'post_title' => 'Block Content Examples', - 'post_content' => require dirname( __FILE__ ) . '/import/content/block-examples.php', - 'post_type' => 'page', - 'post_status' => 'publish', - 'comment_status' => 'closed', - 'ping_status' => 'closed', - 'meta_input' => array( '_genesis_layout' => 'full-width-content' ), - ), - 'about' => array( - 'post_title' => 'About Us', - 'post_content' => require dirname( __FILE__ ) . '/import/content/about.php', - 'post_type' => 'page', - 'post_status' => 'publish', - 'featured_image' => CHILD_URL . '/config/import/images/about.jpg', - 'comment_status' => 'closed', - 'ping_status' => 'closed', - 'meta_input' => array( '_genesis_layout' => 'full-width-content' ), - ), - 'contact' => array( - 'post_title' => 'Contact Us', - 'post_content' => require dirname( __FILE__ ) . '/import/content/contact.php', - 'post_type' => 'page', - 'post_status' => 'publish', - 'comment_status' => 'closed', - 'ping_status' => 'closed', - ), - 'landing' => array( - 'post_title' => 'Landing Page', - 'post_content' => require dirname( __FILE__ ) . '/import/content/landing-page.php', - 'post_type' => 'page', - 'post_status' => 'publish', - 'page_template' => 'page-templates/landing.php', - 'comment_status' => 'closed', - 'ping_status' => 'closed', - ), - ), - 'navigation_menus' => array( - 'primary' => array( - 'homepage' => array( - 'title' => 'Home', - ), - 'about' => array( - 'title' => 'About Us', - ), - 'contact' => array( - 'title' => 'Contact Us', - ), - 'blocks' => array( - 'title' => 'Block Examples', - ), - 'landing' => array( - 'title' => 'Landing Page', - ), - ), - ), -); +$genesis_sample_shared_content = genesis_get_config( 'onboarding-shared' ); + +return [ + 'starter_packs' => [ + 'black-white' => [ + 'title' => __( 'Black & White', 'genesis-sample' ), + 'description' => __( 'A pack with a homepage designed with black and white images.', 'genesis-sample' ), + 'thumbnail' => get_stylesheet_directory_uri() . '/config/import/images/thumbnails/home-black-white.jpg', + 'demo_url' => 'https://demo.studiopress.com/genesis-sample/', + 'config' => [ + 'dependencies' => [ + 'plugins' => $genesis_sample_shared_content['plugins'], + ], + 'content' => array_merge( + [ + 'homepage' => [ + 'post_title' => 'Homepage', + 'post_content' => require dirname( __FILE__ ) . '/import/content/home-black-white.php', + 'post_type' => 'page', + 'post_status' => 'publish', + 'comment_status' => 'closed', + 'ping_status' => 'closed', + 'meta_input' => [ + '_genesis_layout' => 'full-width-content', + '_genesis_hide_title' => true, + '_genesis_hide_breadcrumbs' => true, + '_genesis_hide_singular_image' => true, + ], + ], + ], + $genesis_sample_shared_content['content'] + ), + 'navigation_menus' => $genesis_sample_shared_content['navigation_menus'], + 'widgets' => $genesis_sample_shared_content['widgets'], + ], + ], + 'color' => [ + 'title' => __( 'Color', 'genesis-sample' ), + 'description' => __( 'A pack with a homepage designed with color images.', 'genesis-sample' ), + 'thumbnail' => get_stylesheet_directory_uri() . '/config/import/images/thumbnails/home-color.jpg', + 'demo_url' => 'https://demo.studiopress.com/genesis-sample/home-color/', + 'config' => [ + 'dependencies' => [ + 'plugins' => $genesis_sample_shared_content['plugins'], + ], + 'content' => array_merge( + [ + 'homepage' => [ + 'post_title' => 'Homepage', + 'post_content' => require dirname( __FILE__ ) . '/import/content/home-color.php', + 'post_type' => 'page', + 'post_status' => 'publish', + 'comment_status' => 'closed', + 'ping_status' => 'closed', + 'meta_input' => [ + '_genesis_layout' => 'full-width-content', + '_genesis_hide_title' => true, + '_genesis_hide_breadcrumbs' => true, + '_genesis_hide_singular_image' => true, + ], + ], + ], + $genesis_sample_shared_content['content'] + ), + 'navigation_menus' => $genesis_sample_shared_content['navigation_menus'], + 'widgets' => $genesis_sample_shared_content['widgets'], + ], + ], + ], +]; diff --git a/config/post-type-supports.php b/config/post-type-supports.php new file mode 100644 index 00000000..0583bf1b --- /dev/null +++ b/config/post-type-supports.php @@ -0,0 +1,20 @@ + [ + 'genesis-singular-images', + ], + 'page' => [ + 'genesis-singular-images', + ], +]; diff --git a/config/responsive-menus.php b/config/responsive-menus.php index 401b35c7..bde84a34 100644 --- a/config/responsive-menus.php +++ b/config/responsive-menus.php @@ -11,13 +11,13 @@ /** * Genesis responsive menus settings. (Requires Genesis 3.0+.) */ -return array( - 'script' => array( - 'menuClasses' => array( - 'others' => array( '.nav-primary' ), - ), - ), - 'extras' => array( +return [ + 'script' => [ + 'menuClasses' => [ + 'others' => [ '.nav-primary' ], + ], + ], + 'extras' => [ 'media_query_width' => '960px', - ), -); + ], +]; diff --git a/config/simple-social-icons-settings.php b/config/simple-social-icons-settings.php index b60991e1..8ec06d4a 100644 --- a/config/simple-social-icons-settings.php +++ b/config/simple-social-icons-settings.php @@ -8,7 +8,7 @@ * @link https://www.studiopress.com/ */ -return array( +return [ 'alignment' => 'alignleft', 'background_color' => '#f5f5f5', 'background_color_hover' => '#333333', @@ -17,4 +17,4 @@ 'icon_color' => '#333333', 'icon_color_hover' => '#ffffff', 'size' => 40, -); +]; diff --git a/config/theme-supports.php b/config/theme-supports.php index 756d98d5..b47b124b 100644 --- a/config/theme-supports.php +++ b/config/theme-supports.php @@ -10,30 +10,30 @@ * @link https://my.studiopress.com/themes/genesis-sample/ */ -return array( - 'custom-logo' => array( +return [ + 'genesis-custom-logo' => [ 'height' => 120, 'width' => 700, 'flex-height' => true, 'flex-width' => true, - ), - 'html5' => array( + ], + 'html5' => [ 'caption', 'comment-form', 'comment-list', 'gallery', 'search-form', - ), - 'genesis-accessibility' => array( + ], + 'genesis-accessibility' => [ 'drop-down-menu', 'headings', 'search-form', 'skip-links', - ), + ], 'genesis-after-entry-widget-area' => '', 'genesis-footer-widgets' => 3, - 'genesis-menus' => array( + 'genesis-menus' => [ 'primary' => __( 'Header Menu', 'genesis-sample' ), 'secondary' => __( 'Footer Menu', 'genesis-sample' ), - ), -); + ], +]; diff --git a/functions.php b/functions.php index 3071f286..5163794d 100755 --- a/functions.php +++ b/functions.php @@ -74,7 +74,7 @@ function genesis_sample_enqueue_scripts_styles() { wp_enqueue_style( genesis_get_theme_handle() . '-fonts', $appearance['fonts-url'], - array(), + [], genesis_get_theme_version() ); @@ -84,7 +84,7 @@ function genesis_sample_enqueue_scripts_styles() { wp_enqueue_style( genesis_get_theme_handle() . '-amp', get_stylesheet_directory_uri() . '/lib/amp/amp.css', - array( genesis_get_theme_handle() ), + [ genesis_get_theme_handle() ], genesis_get_theme_version() ); } @@ -109,32 +109,27 @@ function genesis_sample_theme_support() { } -add_filter( 'genesis_seo_title', 'genesis_sample_header_title', 10, 3 ); +add_action( 'after_setup_theme', 'genesis_sample_post_type_support', 9 ); /** - * Removes the link from the hidden site title if a custom logo is in use. + * Add desired post type supports. * - * Without this filter, the site title is hidden with CSS when a custom logo - * is in use, but the link it contains is still accessible by keyboard. + * See config file at `config/post-type-supports.php`. * - * @since 1.2.0 - * - * @param string $title The full title. - * @param string $inside The content inside the title element. - * @param string $wrap The wrapping element name, such as h1. - * @return string The site title with anchor removed if a custom logo is active. + * @since 3.0.0 */ -function genesis_sample_header_title( $title, $inside, $wrap ) { +function genesis_sample_post_type_support() { - if ( has_custom_logo() ) { - $inside = get_bloginfo( 'name' ); - } + $post_type_supports = genesis_get_config( 'post-type-supports' ); - return sprintf( '<%1$s class="site-title">%2$s', $wrap, $inside ); + foreach ( $post_type_supports as $post_type => $args ) { + add_post_type_support( $post_type, $args ); + } } // Adds image sizes. add_image_size( 'sidebar-featured', 75, 75, true ); +add_image_size( 'genesis-singular-images', 702, 526, true ); // Removes header right widget area. unregister_sidebar( 'header-right' ); @@ -147,26 +142,6 @@ function genesis_sample_header_title( $title, $inside, $wrap ) { genesis_unregister_layout( 'sidebar-content-sidebar' ); genesis_unregister_layout( 'sidebar-sidebar-content' ); -add_filter( 'genesis_customizer_theme_settings_config', 'genesis_sample_remove_customizer_settings' ); -/** - * Removes output of header and front page breadcrumb settings in the Customizer. - * - * @since 2.6.0 - * - * @param array $config Original Customizer items. - * @return array Filtered Customizer items. - */ -function genesis_sample_remove_customizer_settings( $config ) { - - unset( $config['genesis']['sections']['genesis_header'] ); - unset( $config['genesis']['sections']['genesis_breadcrumbs']['controls']['breadcrumb_front_page'] ); - return $config; - -} - -// Displays custom logo. -add_action( 'genesis_site_title', 'the_custom_logo', 0 ); - // Repositions primary navigation menu. remove_action( 'genesis_after_header', 'genesis_do_nav' ); add_action( 'genesis_header', 'genesis_do_nav', 12 ); @@ -186,11 +161,10 @@ function genesis_sample_remove_customizer_settings( $config ) { */ function genesis_sample_secondary_menu_args( $args ) { - if ( 'secondary' !== $args['theme_location'] ) { - return $args; + if ( 'secondary' === $args['theme_location'] ) { + $args['depth'] = 1; } - $args['depth'] = 1; return $args; } diff --git a/languages/genesis-sample.pot b/languages/genesis-sample.pot index 79373397..9c72fbbb 100644 --- a/languages/genesis-sample.pot +++ b/languages/genesis-sample.pot @@ -2,9 +2,9 @@ # This file is distributed under the GPL-2.0-or-later.=!> msgid "" msgstr "" -"Project-Id-Version: Genesis Sample 3.0.1\n" +"Project-Id-Version: Genesis Sample 3.1.0\n" "Report-Msgid-Bugs-To: StudioPress \n" -"POT-Creation-Date: 2019-06-24 16:51:49+00:00\n" +"POT-Creation-Date: 2019-08-13 20:37:40+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -47,22 +47,38 @@ msgstr "" msgid "Larger" msgstr "" -#: config/onboarding.php:17 +#: config/onboarding-shared.php:19 msgid "Atomic Blocks" msgstr "" -#: config/onboarding.php:22 +#: config/onboarding-shared.php:24 msgid "Simple Social Icons" msgstr "" -#: config/onboarding.php:27 +#: config/onboarding-shared.php:29 msgid "Genesis eNews Extended (Third Party)" msgstr "" -#: config/onboarding.php:32 +#: config/onboarding-shared.php:34 msgid "WPForms Lite (Third Party)" msgstr "" +#: config/onboarding.php:18 +msgid "Black & White" +msgstr "" + +#: config/onboarding.php:19 +msgid "A pack with a homepage designed with black and white images." +msgstr "" + +#: config/onboarding.php:50 +msgid "Color" +msgstr "" + +#: config/onboarding.php:51 +msgid "A pack with a homepage designed with color images." +msgstr "" + #: config/theme-supports.php:36 msgid "Header Menu" msgstr "" @@ -91,14 +107,22 @@ msgstr "" msgid "Accent Color" msgstr "" -#: lib/customize.php:79 +#: lib/customize.php:80 msgid "Logo Width" msgstr "" -#: lib/customize.php:80 +#: lib/customize.php:81 msgid "The maximum width of the logo in pixels." msgstr "" +#: lib/customize.php:105 +msgid "You must supply a valid number." +msgstr "" + +#: lib/customize.php:107 +msgid "The logo width cannot be less than 100." +msgstr "" + #: lib/woocommerce/woocommerce-notice.php:55 #. translators: %s: child theme name msgid "" @@ -149,10 +173,6 @@ msgstr "" msgid "https://www.studiopress.com/" msgstr "" -#. Template Name of the plugin/theme -msgid "Blocks" -msgstr "" - #. Template Name of the plugin/theme msgid "Landing" msgstr "" \ No newline at end of file diff --git a/lib/customize.php b/lib/customize.php index aea8ce78..95c39e0c 100644 --- a/lib/customize.php +++ b/lib/customize.php @@ -24,69 +24,89 @@ function genesis_sample_customizer_register( $wp_customize ) { $wp_customize->add_setting( 'genesis_sample_link_color', - array( + [ 'default' => $appearance['default-colors']['link'], 'sanitize_callback' => 'sanitize_hex_color', - ) + ] ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'genesis_sample_link_color', - array( + [ 'description' => __( 'Change the color of post info links and button blocks, the hover color of linked titles and menu items, and more.', 'genesis-sample' ), 'label' => __( 'Link Color', 'genesis-sample' ), 'section' => 'colors', 'settings' => 'genesis_sample_link_color', - ) + ] ) ); $wp_customize->add_setting( 'genesis_sample_accent_color', - array( + [ 'default' => $appearance['default-colors']['accent'], 'sanitize_callback' => 'sanitize_hex_color', - ) + ] ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'genesis_sample_accent_color', - array( + [ 'description' => __( 'Change the default hover color for button links, menu buttons, and submit buttons. The button block uses the Link Color.', 'genesis-sample' ), 'label' => __( 'Accent Color', 'genesis-sample' ), 'section' => 'colors', 'settings' => 'genesis_sample_accent_color', - ) + ] ) ); $wp_customize->add_setting( 'genesis_sample_logo_width', - array( + [ 'default' => 350, 'sanitize_callback' => 'absint', - ) + 'validate_callback' => 'genesis_sample_validate_logo_width', + ] ); // Add a control for the logo size. $wp_customize->add_control( 'genesis_sample_logo_width', - array( + [ 'label' => __( 'Logo Width', 'genesis-sample' ), 'description' => __( 'The maximum width of the logo in pixels.', 'genesis-sample' ), 'priority' => 9, 'section' => 'title_tagline', 'settings' => 'genesis_sample_logo_width', 'type' => 'number', - 'input_attrs' => array( + 'input_attrs' => [ 'min' => 100, - ), + ], - ) + ] ); } + +/** + * Displays a message if the entered width is not numeric or greater than 100. + * + * @param object $validity The validity status. + * @param int $width The width entered by the user. + * @return int The new width. + */ +function genesis_sample_validate_logo_width( $validity, $width ) { + + if ( empty( $width ) || ! is_numeric( $width ) ) { + $validity->add( 'required', __( 'You must supply a valid number.', 'genesis-sample' ) ); + } elseif ( $width < 100 ) { + $validity->add( 'logo_too_small', __( 'The logo width cannot be less than 100.', 'genesis-sample' ) ); + } + + return $validity; + +} diff --git a/lib/gutenberg/front-end.css b/lib/gutenberg/front-end.css index 6f5ad3c3..abdf8bd4 100644 --- a/lib/gutenberg/front-end.css +++ b/lib/gutenberg/front-end.css @@ -373,18 +373,6 @@ hr.wp-block-separator { } -/* Page Templates ----------------------------------------------------------------------------- */ - -.page-template-blocks .site-inner { - padding-top: 0; -} - -.page-template-blocks .post-edit-link { - display: block; - text-align: center; -} - /* Media Queries ---------------------------------------------------------------------------- */ diff --git a/lib/gutenberg/init.php b/lib/gutenberg/init.php index 34b66252..e1755e2e 100644 --- a/lib/gutenberg/init.php +++ b/lib/gutenberg/init.php @@ -19,7 +19,7 @@ function genesis_sample_enqueue_gutenberg_frontend_styles() { wp_enqueue_style( genesis_get_theme_handle() . '-gutenberg', get_stylesheet_directory_uri() . '/lib/gutenberg/front-end.css', - array( genesis_get_theme_handle() ), + [ genesis_get_theme_handle() ], genesis_get_theme_version() ); @@ -38,7 +38,7 @@ function genesis_sample_block_editor_styles() { wp_enqueue_style( genesis_get_theme_handle() . '-gutenberg-fonts', $appearance['fonts-url'], - array(), + [], genesis_get_theme_version() ); diff --git a/lib/woocommerce/woocommerce-notice.php b/lib/woocommerce/woocommerce-notice.php index 4107bc0c..466aeb9e 100644 --- a/lib/woocommerce/woocommerce-notice.php +++ b/lib/woocommerce/woocommerce-notice.php @@ -61,10 +61,10 @@ function genesis_sample_woocommerce_theme_notice() { '%s', wp_nonce_url( add_query_arg( - array( + [ 'action' => 'install-plugin', 'plugin' => $plugin_slug, - ), + ], $admin_url ), 'install-plugin_' . $plugin_slug @@ -100,7 +100,7 @@ function genesis_sample_dismiss_woocommerce_notice() { */ function genesis_sample_notice_script() { - wp_enqueue_script( 'genesis_sample_notice_script', get_stylesheet_directory_uri() . '/lib/woocommerce/js/notice-update.js', array( 'jquery' ), '1.0', true ); + wp_enqueue_script( 'genesis_sample_notice_script', get_stylesheet_directory_uri() . '/lib/woocommerce/js/notice-update.js', [ 'jquery' ], '1.0', true ); } @@ -114,10 +114,10 @@ function genesis_sample_reset_woocommerce_notice() { global $wpdb; - $args = array( + $args = [ 'meta_key' => $wpdb->prefix . 'genesis_sample_woocommerce_message_dismissed', 'meta_value' => 1, - ); + ]; $users = get_users( $args ); foreach ( $users as $user ) { diff --git a/lib/woocommerce/woocommerce-output.php b/lib/woocommerce/woocommerce-output.php index a6d9a82b..1e93798f 100644 --- a/lib/woocommerce/woocommerce-output.php +++ b/lib/woocommerce/woocommerce-output.php @@ -21,12 +21,12 @@ */ function genesis_sample_woocommerce_styles( $enqueue_styles ) { - $enqueue_styles[ genesis_get_theme_handle() . '-woocommerce-styles' ] = array( + $enqueue_styles[ genesis_get_theme_handle() . '-woocommerce-styles' ] = [ 'src' => get_stylesheet_directory_uri() . '/lib/woocommerce/genesis-sample-woocommerce.css', 'deps' => '', 'version' => genesis_get_theme_version(), 'media' => 'screen', - ); + ]; return $enqueue_styles; diff --git a/lib/woocommerce/woocommerce-setup.php b/lib/woocommerce/woocommerce-setup.php index 9207cfd1..867f5a51 100644 --- a/lib/woocommerce/woocommerce-setup.php +++ b/lib/woocommerce/woocommerce-setup.php @@ -30,12 +30,12 @@ function genesis_sample_woocommerce_breakpoint() { $current = genesis_site_layout( false ); - $layouts = array( - 'one-sidebar' => array( + $layouts = [ + 'one-sidebar' => [ 'content-sidebar', 'sidebar-content', - ), - ); + ], + ]; if ( in_array( $current, $layouts['one-sidebar'], true ) ) { return '1200px'; @@ -142,11 +142,11 @@ function genesis_sample_update_woocommerce_image_dimensions() { */ function genesis_sample_gallery_image_thumbnail( $size ) { - $size = array( + $size = [ 'width' => 180, 'height' => 180, 'crop' => 1, - ); + ]; return $size; diff --git a/lib/wpforms.php b/lib/wpforms.php index 68df1260..ce0e1a03 100644 --- a/lib/wpforms.php +++ b/lib/wpforms.php @@ -53,11 +53,11 @@ function studiopress_maybe_create_wpforms_form() { // phpcs:ignore -- studiopres // Creates a form using the WPForms 'contact' template. $new_form_id = wpforms()->form->add( esc_html__( 'Simple Contact Form', 'genesis-sample' ), - array(), - array( + [], + [ 'template' => 'contact', 'builder' => false, - ) + ] ); if ( $new_form_id ) { @@ -80,10 +80,10 @@ function studiopress_insert_contact_form( $content, $imported_posts ) { // phpcs $form_id = studiopress_maybe_create_wpforms_form(); if ( $form_id && array_key_exists( 'contact', $imported_posts ) ) { - $contact_page = array( + $contact_page = [ 'ID' => $imported_posts['contact'], 'post_content' => "", - ); + ]; wp_update_post( $contact_page ); } diff --git a/package-lock.json b/package-lock.json index 34209eee..bb4bb4ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3085,9 +3085,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", "dev": true }, "lodash.assign": { @@ -4052,7 +4052,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { diff --git a/package.json b/package.json index 4c7e7d08..df6cfef8 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "description": "The sample child theme for the Genesis Framework.", "author": "StudioPress", "authoruri": "https://www.studiopress.com/", - "version": "3.0.1", + "version": "3.1.0", "tags": "one-column, two-columns, left-sidebar, right-sidebar, accessibility-ready, custom-colors, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready", "license": "GPL-2.0-or-later", "licenseuri": "https://www.gnu.org/licenses/gpl-2.0.html", diff --git a/page-templates/blocks.php b/page-templates/blocks.php deleted file mode 100644 index fe89ae0d..00000000 --- a/page-templates/blocks.php +++ /dev/null @@ -1,27 +0,0 @@ - - + - + + - + @@ -72,4 +73,7 @@ + + + diff --git a/screenshot.png b/screenshot.png index b4edf107..b0bc7bea 100644 Binary files a/screenshot.png and b/screenshot.png differ diff --git a/style.css b/style.css index 214122b3..cce09a79 100755 --- a/style.css +++ b/style.css @@ -5,7 +5,7 @@ Description: This is the sample theme created for the Genesis Framework. Author: StudioPress Author URI: https://www.studiopress.com/ -Version: 3.0.1 +Version: 3.1.0 Tags: accessibility-ready, block-styles, custom-colors, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, left-sidebar, one-column, right-sidebar, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, two-columns, wide-blocks @@ -647,6 +647,10 @@ th:last-child { padding-bottom: 10px; } +.genesis-title-hidden .breadcrumb { + margin-top: 40px; +} + .archive-description p:last-child, .author-box p:last-child { margin-bottom: 0; @@ -712,6 +716,10 @@ th:last-child { margin-bottom: 20px; } +.genesis-title-hidden .site-inner { + padding-top: 0; +} + /* WordPress --------------------------------------------- */ @@ -741,7 +749,8 @@ a.alignright { } img.centered, -.aligncenter { +.aligncenter, +.singular-image { display: block; margin: 0 auto 30px; } @@ -1573,8 +1582,7 @@ p.entry-meta { float: right; } - .full-width-content .content, - .landing-page .content { + .full-width-content .content { float: none; margin-left: auto; margin-right: auto;