From 8665dca5cc5363c77a76c3c84ea1e1a28875d1e6 Mon Sep 17 00:00:00 2001 From: Nathan Schmidt <91974372+nathan-schmidt-viget@users.noreply.github.com> Date: Tue, 12 Dec 2023 10:52:31 -0700 Subject: [PATCH] [#8] updating templates --- themes/goodbids-nonprofit/functions.php | 17 +++-------- themes/goodbids-nonprofit/inc/patterns.php | 30 +++++++++---------- .../patterns/template-home-nonprofit.php | 4 --- themes/goodbids-nonprofit/style.css | 4 +-- .../templates/front-page.html | 4 ++- themes/goodbids-nonprofit/templates/page.html | 1 + 6 files changed, 25 insertions(+), 35 deletions(-) create mode 100644 themes/goodbids-nonprofit/templates/page.html diff --git a/themes/goodbids-nonprofit/functions.php b/themes/goodbids-nonprofit/functions.php index babaff848..08cb4a1b2 100644 --- a/themes/goodbids-nonprofit/functions.php +++ b/themes/goodbids-nonprofit/functions.php @@ -4,24 +4,15 @@ * * @package GoodBids_Nonprofit * - * @since 1.0 + * @since 1.0.0 */ - /** +/** * Load Theme Assets - * - * @package GoodBids_Nonprofit - * - * @since 1.0 */ - require_once get_stylesheet_directory() . '/inc/assets.php'; - +require_once get_stylesheet_directory() . '/inc/assets.php'; /** * Load Theme Patterns - * - * @package GoodBids_Nonprofit - * - * @since 1.0 */ - require_once get_stylesheet_directory() . '/inc/patterns.php'; +require_once get_stylesheet_directory() . '/inc/patterns.php'; diff --git a/themes/goodbids-nonprofit/inc/patterns.php b/themes/goodbids-nonprofit/inc/patterns.php index 15d60a610..a7382ddb2 100644 --- a/themes/goodbids-nonprofit/inc/patterns.php +++ b/themes/goodbids-nonprofit/inc/patterns.php @@ -4,21 +4,21 @@ * * @package GoodBids_Nonprofit * - * @since 1.0 + * @since 1.0.0 */ /** * Register Component Pattern Category * - * @since 1.0 + * @since 1.0.0 */ add_action( 'init', - function() { + function () { register_block_pattern_category( 'goodBids-nonprofit', [ - 'label' => __( 'GoodBids Non-profit', 'goodbids-nonprofit' ), + 'label' => __( 'GoodBids Nonprofit', 'goodbids-nonprofit' ), ] ); } @@ -27,21 +27,21 @@ function() { /** * Register Patterns * - * @since 1.0 + * @since 1.0.0 */ add_action( 'init', - function() { + function () { $patterns = [ [ - 'name' => 'template-home-nonprofit', - 'path' => 'patterns/template-home-nonprofit.php', - 'title' => __( 'Non-profit Home Template', 'goodbids-nonprofit' ), - 'description' => _x( 'Template for the Non-profit Homepage', 'Block pattern description', 'goodbids-nonprofit' ), - 'categories' => ['featured', 'goodBids-nonprofit'], - 'keywords' => ['home', 'non-profit', 'template', 'page'], - 'templateTypes' => ['front-page', 'home', 'page'], - ] + 'name' => 'template-home-nonprofit', + 'path' => 'patterns/template-home-nonprofit.php', + 'title' => __( 'Nonprofit Home Template', 'goodbids-nonprofit' ), + 'description' => _x( 'Template for the Nonprofit Homepage', 'Block pattern description', 'goodbids-nonprofit' ), + 'categories' => [ 'featured', 'goodBids-nonprofit' ], + 'keywords' => [ 'home', 'non-profit', 'template', 'page' ], + 'templateTypes' => [ 'front-page', 'home', 'page' ], + ], ]; foreach ( $patterns as $pattern ) { @@ -57,7 +57,7 @@ function() { include $path; $content = ob_get_clean(); } else { - $content = file_get_contents( $path ); + $content = wpcom_vip_file_get_contents( $path ); } $pattern['content'] = $content; diff --git a/themes/goodbids-nonprofit/patterns/template-home-nonprofit.php b/themes/goodbids-nonprofit/patterns/template-home-nonprofit.php index 196f82e05..454a08f06 100644 --- a/themes/goodbids-nonprofit/patterns/template-home-nonprofit.php +++ b/themes/goodbids-nonprofit/patterns/template-home-nonprofit.php @@ -1,9 +1,5 @@ - -
- - diff --git a/themes/goodbids-nonprofit/style.css b/themes/goodbids-nonprofit/style.css index f70788178..6cd2ef4f3 100644 --- a/themes/goodbids-nonprofit/style.css +++ b/themes/goodbids-nonprofit/style.css @@ -1,9 +1,9 @@ /* -Theme Name: GoodBids Non-profit +Theme Name: GoodBids Nonprofit Theme URI: https://goodbids.org Author: Viget Author URI: https://viget.com -Description: Twenty Twenty-Four child theme for GoodBids Non-profit sites. +Description: Twenty Twenty-Four child theme for GoodBids Nonprofit sites. Version: 1.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html diff --git a/themes/goodbids-nonprofit/templates/front-page.html b/themes/goodbids-nonprofit/templates/front-page.html index 973409c09..224527cf1 100644 --- a/themes/goodbids-nonprofit/templates/front-page.html +++ b/themes/goodbids-nonprofit/templates/front-page.html @@ -1 +1,3 @@ - + + + diff --git a/themes/goodbids-nonprofit/templates/page.html b/themes/goodbids-nonprofit/templates/page.html new file mode 100644 index 000000000..6b5e8f7e2 --- /dev/null +++ b/themes/goodbids-nonprofit/templates/page.html @@ -0,0 +1 @@ +