Skip to content

Commit

Permalink
[#8] updating templates
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-schmidt-viget committed Dec 12, 2023
1 parent 705aa20 commit 8665dca
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 35 deletions.
17 changes: 4 additions & 13 deletions themes/goodbids-nonprofit/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
30 changes: 15 additions & 15 deletions themes/goodbids-nonprofit/inc/patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
]
);
}
Expand All @@ -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 ) {
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->

<!-- wp:group {"tagName":"main","style":{"spacing":{"blockGap":"0","margin":{"top":"0"}}},"layout":{"type":"default"}} -->
<main class="wp-block-group" style="margin-top:0">
<!-- wp:pattern {"slug":"twentytwentyfour/page-home-business"} /-->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer"} /-->
4 changes: 2 additions & 2 deletions themes/goodbids-nonprofit/style.css
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion themes/goodbids-nonprofit/templates/front-page.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<!-- wp:pattern {"slug":"goodbids-nonprofit/template-home-nonprofit"} /-->
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->
<!-- wp:pattern {"slug":"goodbids-nonprofit/template-home-nonprofit"} /-->
<!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer"} /-->
1 change: 1 addition & 0 deletions themes/goodbids-nonprofit/templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"goodbids-nonprofit/template-page-nonprofit"} /-->

0 comments on commit 8665dca

Please sign in to comment.