Skip to content

Commit

Permalink
Add the sidebar as a pattern and template part
Browse files Browse the repository at this point in the history
  • Loading branch information
2ndkauboy committed May 20, 2024
1 parent 5e6f237 commit 5101911
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 3 deletions.
1 change: 1 addition & 0 deletions parts/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"kauri/sidebar"} /-->
35 changes: 35 additions & 0 deletions patterns/sidebar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* Title: Sidebar
* Slug: kauri/sidebar
* Inserter: no
*/
?>
<!-- wp:group {"style":{"spacing":{"padding":{"top":"20px","bottom":"20px","left":"20px","right":"20px"}}},"backgroundColor":"background-secondary","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-background-secondary-background-color has-background" style="padding-top:20px;padding-right:20px;padding-bottom:20px;padding-left:20px">
<!-- wp:search {"label":"Search","showLabel":false,"buttonText":"Search","buttonPosition":"button-inside","buttonUseIcon":true} /-->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading"><?php esc_html_e( 'Recent Posts', 'kauri' ); ?></h3>
<!-- /wp:heading -->

<!-- wp:latest-posts /-->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading"><?php esc_html_e( 'Recent Comments', 'kauri' ); ?></h3>
<!-- /wp:heading -->

<!-- wp:latest-comments {"displayAvatar":false,"displayDate":false,"displayExcerpt":false} /-->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading"><?php esc_html_e( 'Categories', 'kauri' ); ?></h3>
<!-- /wp:heading -->

<!-- wp:categories /-->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading"><?php esc_html_e( 'Archives', 'kauri' ); ?></h3>
<!-- /wp:heading -->

<!-- wp:archives /--></div>
<!-- /wp:group -->
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<!-- /wp:column -->

<!-- wp:column {"width":"300px","style":{"spacing":{"padding":{"top":"0","bottom":"0","left":"0","right":"0"}}}} -->
<div class="wp-block-column" style="padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;flex-basis:300px"><!-- wp:block {"ref":1842} /--></div>
<div class="wp-block-column" style="padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;flex-basis:300px"><!-- wp:template-part {"slug":"sidebar","tagName":"aside"} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->
Expand Down
11 changes: 9 additions & 2 deletions theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,18 @@
"templateParts": [
{
"area": "header",
"name": "header"
"name": "header",
"title": "Header"
},
{
"area": "footer",
"name": "footer"
"name": "footer",
"title": "Footer"
},
{
"area": "uncategorized",
"name": "sidebar",
"title": "Sidebar"
}
],
"version": 2,
Expand Down

0 comments on commit 5101911

Please sign in to comment.