-
Notifications
You must be signed in to change notification settings - Fork 8
Homepage: Add hero section for random featured site #145
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9567075
Homepage: Add hero section for random featured site
ryelle 1798bb1
Remove localhost URL
ryelle d993fc4
Use correct escaping function
ryelle babf77a
Use the scaling border size for header screenshots
ryelle 3deed54
Update the spacing in meta boxes
ryelle e86ec31
Scale up and down the heading dots
ryelle 73b097c
Add post title to available meta, use on hero section
ryelle afe3a54
Update link style in meta list block
ryelle c7f6bb5
Use a custom property from theme.json for the border width
ryelle 4a97ef0
Ensure both hero columns are the same width when in single-column view
ryelle bb43dcd
Update site link color
ryelle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
source/wp-content/themes/wporg-showcase-2022/images/dots-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions
55
source/wp-content/themes/wporg-showcase-2022/patterns/_site-hero.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| <?php | ||
| /** | ||
| * Title: Site Hero (Featured) | ||
| * Slug: wporg-showcase-2022/site-hero | ||
| * Inserter: no | ||
| * | ||
| * This renders a random single sticky (hero featured) site. | ||
| */ | ||
|
|
||
| ?> | ||
| <!-- wp:query {"queryId":0,"query":{"perPage":"1","pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"rand","author":"","search":"","exclude":[],"sticky":"only","inherit":false},"className":"is-section-site-hero"} --> | ||
| <div class="wp-block-query is-section-site-hero"> | ||
| <!-- wp:post-template --> | ||
| <!-- wp:columns {"style":{"spacing":{"blockGap":{"top":"var:preset|spacing|30","left":"var:preset|spacing|50"}}}} --> | ||
| <div class="wp-block-columns"> | ||
| <!-- wp:column {"width":"24%"} --> | ||
| <div class="wp-block-column" style="flex-basis:24%"> | ||
| <!-- wp:group {"layout":{"type":"constrained"}} --> | ||
| <div class="wp-block-group"> | ||
| <!-- wp:spacer {"height":"var:preset|spacing|50"} --> | ||
| <div style="height:var(--wp--preset--spacing--50)" aria-hidden="true" class="wp-block-spacer"></div> | ||
| <!-- /wp:spacer --> | ||
|
|
||
| <!-- wp:heading {"fontSize":"heading-2"} --> | ||
| <h1 class="wp-block-heading has-heading-2-font-size"><?php esc_attr_e( 'Showcase', 'wporg' ); ?></h1> | ||
| <!-- /wp:heading --> | ||
|
|
||
| <!-- wp:paragraph {style":{"spacing":{"margin":{"top":"var:preset|spacing|10"}}}} --> | ||
| <p style="margin-top:var(--wp--preset--spacing--10)"><?php esc_attr_e( 'Star-studded sites built with WordPress', 'wporg' ); ?></p> | ||
| <!-- /wp:paragraph --> | ||
|
|
||
| <!-- wp:wporg/site-meta-list {"meta":["author","domain","category"],"showLabel":false,"style":{"elements":{"link":{"color":{"text":"var:preset|color|blueberry-2"}}},"border":{"radius":"2px","style":"solid","width":"1px"},"spacing":{"margin":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"}}},"borderColor":"charcoal-3","textColor":"light-grey-2"} /--> | ||
| </div> | ||
| <!-- /wp:group --> | ||
| </div> | ||
| <!-- /wp:column --> | ||
|
|
||
| <!-- wp:column {"verticalAlignment":"bottom"} --> | ||
| <div class="wp-block-column is-vertically-aligned-bottom"> | ||
| <!-- wp:cover {"url":"http://localhost:8888/wp-content/themes/wporg-showcase-2022/images/dots-dark.svg","isRepeated":true,"dimRatio":0,"focalPoint":{"x":0.5,"y":0},"minHeight":440,"contentPosition":"bottom center","style":{"spacing":{"padding":{"top":"70px","right":"70px","bottom":"0","left":"70px"}}},"layout":{"type":"constrained"}} --> | ||
| <div class="wp-block-cover is-repeated has-custom-content-position is-position-bottom-center" style="padding-top:70px;padding-right:70px;padding-bottom:0;padding-left:70px;min-height:440px"> | ||
| <span aria-hidden="true" class="wp-block-cover__background has-background-dim-0 has-background-dim"></span> | ||
| <div role="img" class="wp-block-cover__image-background is-repeated" style="background-position:50% 0%;background-image:url(http://localhost:8888/wp-content/themes/wporg-showcase-2022/images/dots-dark.svg)"></div> | ||
ryelle marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <div class="wp-block-cover__inner-container"> | ||
| <!-- wp:wporg/site-screenshot {"isLink":true} /--> | ||
| </div> | ||
| </div> | ||
| <!-- /wp:cover --> | ||
| </div> | ||
| <!-- /wp:column --> | ||
| </div> | ||
| <!-- /wp:columns --> | ||
| <!-- /wp:post-template --> | ||
| </div> | ||
| <!-- /wp:query --> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.