Skip to content

Commit e2ae63e

Browse files
Merge pull request WordPress#706 from WordPress/705-blog-template-homehtml-ignores-main-query-and-breaks-navigation
Change post pattern on `home.html`, update template slugs
2 parents a96a3ea + dd8fc54 commit e2ae63e

File tree

4 files changed

+67
-5
lines changed

4 files changed

+67
-5
lines changed

patterns/page-home-business.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* Title: Business home
4-
* Slug: twentytwentyfour/home-business
4+
* Slug: twentytwentyfour/page-home-business
55
* Categories: page
66
* Keywords: starter
77
* Block Types: core/post-content
@@ -14,5 +14,5 @@
1414
<!-- wp:pattern {"slug":"twentytwentyfour/text-feature-grid-3-col"} /-->
1515
<!-- wp:pattern {"slug":"twentytwentyfour/text-alternating-images"} /-->
1616
<!-- wp:pattern {"slug":"twentytwentyfour/testimonial-centered"} /-->
17-
<!-- wp:pattern {"slug":"twentytwentyfour/posts-grid-2-col"} /-->
17+
<!-- wp:pattern {"slug":"twentytwentyfour/posts-list"} /-->
1818
<!-- wp:pattern {"slug":"twentytwentyfour/cta-subscribe-centered"} /-->

patterns/posts-list.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/**
3+
* Title: List of posts without images, 1 column
4+
* Slug: twentytwentyfour/posts-list
5+
* Categories: query, posts
6+
* Block Types: core/query
7+
*/
8+
?>
9+
10+
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"},"margin":{"top":"0","bottom":"0"}}},"layout":{"type":"constrained"}} -->
11+
<div class="wp-block-group alignfull" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)">
12+
<!-- wp:heading {"align":"wide","style":{"typography":{"lineHeight":"1"},"spacing":{"margin":{"top":"0","bottom":"var:preset|spacing|40"}}},"fontSize":"x-large"} -->
13+
<h2 class="wp-block-heading alignwide has-x-large-font-size" style="margin-top:0;margin-bottom:var(--wp--preset--spacing--40);line-height:1"><?php esc_html_e( 'Watch, Read, Listen', 'twentytwentyfour' ); ?></h2>
14+
<!-- /wp:heading -->
15+
16+
<!-- wp:group {"align":"wide","layout":{"type":"constrained"}} -->
17+
<div class="wp-block-group alignwide">
18+
<!-- wp:query {"queryId":14,"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"align":"wide","layout":{"type":"default"}} -->
19+
<div class="wp-block-query alignwide">
20+
<!-- wp:post-template -->
21+
<!-- wp:separator {"backgroundColor":"contrast-3","className":"alignwide is-style-wide"} -->
22+
<hr class="wp-block-separator has-text-color has-contrast-3-color has-alpha-channel-opacity has-contrast-3-background-color has-background alignwide is-style-wide" />
23+
<!-- /wp:separator -->
24+
25+
<!-- wp:columns {"verticalAlignment":"center","align":"wide","style":{"spacing":{"margin":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20"}}}} -->
26+
<div class="wp-block-columns alignwide are-vertically-aligned-center" style="margin-top:var(--wp--preset--spacing--20);margin-bottom:var(--wp--preset--spacing--20)">
27+
<!-- wp:column {"verticalAlignment":"center","width":"72%"} -->
28+
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:72%">
29+
<!-- wp:post-title {"isLink":true,"style":{"typography":{"lineHeight":"1.1","fontSize":"1.5rem"}}} /-->
30+
</div>
31+
<!-- /wp:column -->
32+
33+
<!-- wp:column {"verticalAlignment":"center","width":"28%"} -->
34+
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:28%">
35+
<!-- wp:template-part {"slug":"post-meta"} /-->
36+
</div>
37+
<!-- /wp:column -->
38+
</div>
39+
<!-- /wp:columns -->
40+
<!-- /wp:post-template -->
41+
42+
<!-- wp:spacer {"height":"var:preset|spacing|30"} -->
43+
<div style="height:var(--wp--preset--spacing--30)" aria-hidden="true" class="wp-block-spacer"></div>
44+
<!-- /wp:spacer -->
45+
46+
<!-- wp:query-pagination {"paginationArrow":"arrow","layout":{"type":"flex","justifyContent":"space-between"}} -->
47+
<!-- wp:query-pagination-previous /-->
48+
49+
<!-- wp:query-pagination-numbers /-->
50+
51+
<!-- wp:query-pagination-next /-->
52+
<!-- /wp:query-pagination -->
53+
54+
<!-- wp:query-no-results -->
55+
<!-- wp:pattern {"slug":"twentytwentyfour/hidden-no-results"} /-->
56+
<!-- /wp:query-no-results -->
57+
</div>
58+
<!-- /wp:query -->
59+
</div>
60+
<!-- /wp:group -->
61+
</div>
62+
<!-- /wp:group -->

patterns/template-home-business.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* Title: Business home template
4-
* Slug: twentytwentyfour/template-home
4+
* Slug: twentytwentyfour/template-home-business
55
* Template Types: front-page, home
66
* Viewport width: 1400
77
* Inserter: no
@@ -12,7 +12,7 @@
1212

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

templates/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!-- wp:pattern {"slug":"twentytwentyfour/template-home"} /-->
1+
<!-- wp:pattern {"slug":"twentytwentyfour/template-home-business"} /-->

0 commit comments

Comments
 (0)