Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

curator: recent-posts pattern #6032

Closed
wants to merge 1 commit into from
Closed
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
22 changes: 22 additions & 0 deletions curator/patterns/recent-posts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* Title: Recent posts
* Slug: curator/recent-posts
* Categories: query
*/

?>

<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"2rem","bottom":"2rem"}}}} -->
<div class="wp-block-group alignwide" style="padding-top:2rem;padding-bottom:2rem"><!-- wp:heading {"level":6} -->
<h6><?php echo esc_html__( 'Recent posts', 'curator' ); ?></h6>
<!-- /wp:heading -->

<!-- wp:query {"queryId":3,"query":{"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"perPage":3}} -->
<div class="wp-block-query"><!-- wp:post-template -->
<!-- wp:group {"style":{"border":{"bottom":{"width":"1px"}}}} -->
<div class="wp-block-group" style="border-bottom-width:1px"><!-- wp:post-title {"level":1,"isLink":true} /--></div>
<!-- /wp:group -->
<!-- /wp:post-template --></div>
<!-- /wp:query --></div>
<!-- /wp:group -->
7 changes: 7 additions & 0 deletions curator/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ a:not(
background-color: var(--wp--preset--color--tertiary);
}

/*
* Post template block
*/
.wp-block-post-template .wp-block-post {
margin-top: 0.5rem;
}


/*
* Alignment styles, borrowed from Twenty Twenty-Two.
Expand Down