Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TT1 Blocks: Clean up for Theme Repo #149

Merged
merged 22 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions tt1-blocks/block-template-parts/query.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!-- wp:query {"queryId":1,"query":{"perPage":"","pages":"","offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[2227],"sticky":"","inherit":true}} -->
<!-- wp:query-loop -->
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:post-content /-->

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:separator {"align":"center","className":"is-style-twentytwentyone-separator-thick"} -->
<hr class="wp-block-separator aligncenter is-style-twentytwentyone-separator-thick"/>
<!-- /wp:separator -->

<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:post-date /-->

<!-- wp:post-author {"showAvatar":false} /--></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:post-hierarchical-terms {"term":"category","textAlign":"right"} /-->

<!-- wp:post-tags {"textAlign":"right"} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- /wp:query-loop -->
<!-- /wp:query -->
35 changes: 1 addition & 34 deletions tt1-blocks/block-templates/archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,6 @@ <h1 class="alignwide">Archive</h1>
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:query {"queryId":1}} -->
<!-- wp:query-loop -->
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:post-content /-->

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:separator {"align":"center","className":"is-style-twentytwentyone-separator-thick"} -->
<hr class="wp-block-separator aligncenter is-style-twentytwentyone-separator-thick"/>
<!-- /wp:separator -->

<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:post-date /-->

<!-- wp:post-author {"showAvatar":false} /--></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:post-hierarchical-terms {"term":"category","textAlign":"right"} /-->

<!-- wp:post-tags {"textAlign":"right"} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- /wp:query-loop -->
<!-- /wp:query -->
<!-- wp:template-part {"slug":"query","theme":"tt1-blocks","align":"full"} /-->

<!-- wp:template-part {"slug":"footer","theme":"tt1-blocks","align":"full","tagName":"footer","className":"site-footer"} /-->
35 changes: 1 addition & 34 deletions tt1-blocks/block-templates/index.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,5 @@
<!-- wp:template-part {"slug":"header","theme":"tt1-blocks","align":"full", "tagName":"header","className":"site-header"} /-->

<!-- wp:query {"queryId":1,"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":""}} -->
<!-- wp:query-loop -->
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:post-content /-->

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:separator {"align":"center","className":"is-style-twentytwentyone-separator-thick"} -->
<hr class="wp-block-separator aligncenter is-style-twentytwentyone-separator-thick"/>
<!-- /wp:separator -->

<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:post-date /-->

<!-- wp:post-author {"showAvatar":false} /--></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:post-hierarchical-terms {"term":"category","textAlign":"right"} /-->

<!-- wp:post-tags {"textAlign":"right"} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- /wp:query-loop -->
<!-- /wp:query -->
<!-- wp:template-part {"slug":"query","theme":"tt1-blocks","align":"full"} /-->

<!-- wp:template-part {"slug":"footer","theme":"tt1-blocks","align":"full","tagName":"footer","className":"site-footer"} /-->
35 changes: 1 addition & 34 deletions tt1-blocks/block-templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,6 @@ <h1 class="alignwide">Search Results</h1>
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:query {"queryId":1} -->
<!-- wp:query-loop -->
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:post-excerpt /-->

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:separator {"align":"center","className":"is-style-twentytwentyone-separator-thick"} -->
<hr class="wp-block-separator aligncenter is-style-twentytwentyone-separator-thick"/>
<!-- /wp:separator -->

<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:post-date /-->

<!-- wp:post-author {"showAvatar":false} /--></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:post-hierarchical-terms {"term":"category","textAlign":"right"} /-->

<!-- wp:post-tags {"textAlign":"right"} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- /wp:query-loop -->
<!-- /wp:query -->
<!-- wp:template-part {"slug":"query","theme":"tt1-blocks","align":"full"} /-->

<!-- wp:template-part {"slug":"footer","theme":"tt1-blocks","align":"full","tagName":"footer","className":"site-footer"} /-->
10 changes: 10 additions & 0 deletions tt1-blocks/footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/**
* Unused file.
*
* This file is only present to pass the Theme Check. It's not used by the theme.
*/
?>

<?php wp_footer(); ?>
</body>
15 changes: 15 additions & 0 deletions tt1-blocks/header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Unused file.
*
* This file is only present to pass the Theme Check. It's not used by the theme.
*/
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'wp_body_open' ); ?>
3 changes: 2 additions & 1 deletion tt1-blocks/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ body {
}

.wp-site-blocks > *:not(.wp-block-post-content),
.wp-site-blocks .wp-block-post-content > * {
.wp-site-blocks .wp-block-post-content > *,
.wp-block-query-loop li > *:not(.entry-content):not(.alignwide):not(.alignfull) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this creep in by mistake?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I just added that. Previously, all content of the query block was showing up as standard width, even when it was wide/full. 😩 I noticed this when I moved the default query into its own template part, and had to do this to fix it.

Here's an example, where the Media & Text block is supposed to be wide width:

Before f4a0131 After I placed the query block in the full-width template part. Final result, after I added this css.
Screen Shot 2020-12-18 at 9 12 03 AM Screen Shot 2020-12-18 at 9 11 24 AM Screen Shot 2020-12-18 at 9 11 09 AM

(I really can't wait until this alignments stuff "just works" 😞).

max-width: var(--wp--custom--responsive--aligndefault-width);
margin-left: auto;
margin-right: auto;
Expand Down