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

Add block pattern for labeled post links #5015

Merged
merged 2 commits into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
30 changes: 2 additions & 28 deletions skatepark/block-templates/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,6 @@
<div class="wp-block-group"><!-- wp:post-comments /--></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"3em","bottom":"3em"}}},"layout":{"inherit":true}} -->
<div class="wp-block-group" style="padding-top:3em;padding-bottom:3em">
<!-- wp:pattern {"slug":"skatepark/post-navigation-labeled"} /-->

<!-- wp:separator {"align":"wide","className":"is-style-wide"} -->
<hr class="wp-block-separator alignwide is-style-wide"/>
<!-- /wp:separator -->

<!-- wp:columns {"align":"wide","className":"next-prev-links"} -->
<div class="wp-block-columns alignwide next-prev-links">
<!-- wp:column {"style":{"spacing":{"padding":{"top":"1em","bottom":"1em"}}}} -->
<div class="wp-block-column" style="padding-top:1em;padding-bottom:1em">
<!-- wp:post-navigation-link {"type":"previous","showTitle":true} /-->
</div>
<!-- /wp:column -->
<!-- wp:column {"style":{"spacing":{"padding":{"top":"1em","bottom":"1em"}}}} -->
<div class="wp-block-column" style="padding-top:1em;padding-bottom:1em">
<!-- wp:post-navigation-link {"textAlign":"right","showTitle":true} /-->
</div>
<!-- /wp:column -->
</div>
<!-- /wp:columns -->

<!-- wp:separator {"align":"wide","className":"is-style-wide"} -->
<hr class="wp-block-separator alignwide is-style-wide"/>
<!-- /wp:separator -->
</div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true},"className":"site-footer-container"} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true},"className":"site-footer-container"} /-->
1 change: 1 addition & 0 deletions skatepark/inc/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function skatepark_register_block_patterns() {
'two-columns-of-text',
'paragraph-with-quote',
'columns-in-container',
'post-navigation-labeled'
);

foreach ( $block_patterns as $block_pattern ) {
Expand Down
46 changes: 46 additions & 0 deletions skatepark/inc/patterns/post-navigation-labeled.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* Post Navigation Links.
*
* @package Skatepark
*/

return array(
'title' => __( 'Post Navigation Links', 'skatepark' ),
'categories' => array( 'skatepark' ),
'content' => '
<!-- wp:group {"style":{"spacing":{"padding":{"top":"3em","bottom":"3em"}}},"layout":{"inherit":true}} -->
<div class="wp-block-group" style="padding-top:3em;padding-bottom:3em">

<!-- wp:separator {"align":"wide","className":"is-style-wide"} -->
<hr class="wp-block-separator alignwide is-style-wide"/>
<!-- /wp:separator -->

<!-- wp:columns {"align":"wide","className":"next-prev-links"} -->
<div class="wp-block-columns alignwide next-prev-links">
<!-- wp:column {"style":{"spacing":{"padding":{"top":"1em","bottom":"1em"}}}} -->
<div class="wp-block-column" style="padding-top:1em;padding-bottom:1em">
<!-- wp:paragraph {"align":"left","style":{"typography":{"textTransform":"uppercase","fontStyle":"normal","fontWeight":"800","fontSize":"14px","letterSpacing":"0.1em"},"spacing":{"margins":{"top":"0px", "bottom":"0px"}}}} -->
<p class="has-text-align-left" id="next-post" style="font-size:14px;font-style:normal;font-weight:800;text-transform:uppercase;letter-spacing:0.1em;margin-top:0px;margin-bottom:0px;">' . esc_html__( 'previous post', 'skatepark' ) . '</p>
<!-- /wp:paragraph -->
<!-- wp:post-navigation-link {"type":"previous","showTitle":true,"style":{"typography":{"fontSize":"14px"}}} /-->
</div>
<!-- /wp:column -->
<!-- wp:column {"style":{"spacing":{"padding":{"top":"1em","bottom":"1em"}}}} -->
<div class="wp-block-column" style="padding-top:1em;padding-bottom:1em">
<!-- wp:paragraph {"align":"right","style":{"typography":{"textTransform":"uppercase","fontStyle":"normal","fontWeight":"800","fontSize":"14px","letterSpacing":"0.1em"},"spacing":{"margins":{"top":"0px", "bottom":"0px"}}}} -->
<p class="has-text-align-right" id="next-post" style="font-size:14px;font-style:normal;font-weight:800;text-transform:uppercase;letter-spacing:0.1em;margin-top:0px;margin-bottom:0px;">' . esc_html__( 'next post', 'skatepark' ) . '</p>
<!-- /wp:paragraph -->
<!-- wp:post-navigation-link {"textAlign":"right","showTitle":true,"style":{"typography":{"fontSize":"14px"}}} /-->
</div>
<!-- /wp:column -->
</div>
<!-- /wp:columns -->

<!-- wp:separator {"align":"wide","className":"is-style-wide"} -->
<hr class="wp-block-separator alignwide is-style-wide"/>
<!-- /wp:separator -->
</div>
<!-- /wp:group -->
',
);