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

Update theme twentytwentyfour #178

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
Binary file not shown.
Binary file not shown.
Binary file added twentytwentyfour/assets/images/art-gallery.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added twentytwentyfour/assets/images/hotel-facade.webp
Binary file not shown.
Binary file added twentytwentyfour/assets/images/icon-message.webp
Binary file not shown.
Binary file added twentytwentyfour/assets/images/museum.webp
Binary file not shown.
Binary file not shown.
Binary file added twentytwentyfour/assets/images/windows.webp
Binary file not shown.
206 changes: 206 additions & 0 deletions twentytwentyfour/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
<?php
/**
* Twenty Twenty-Four functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Twenty Twenty-Four
* @since Twenty Twenty-Four 1.0
*/

/**
* Register block styles.
*/

if ( ! function_exists( 'twentytwentyfour_block_styles' ) ) :
/**
* Register custom block styles
*
* @since Twenty Twenty-Four 1.0
* @return void
*/
function twentytwentyfour_block_styles() {

register_block_style(
'core/details',
array(
'name' => 'arrow-icon-details',
'label' => __( 'Arrow icon', 'twentytwentyfour' ),
/*
* Styles for the custom Arrow icon style of the Details block
*/
'inline_style' => '
.is-style-arrow-icon-details {
padding-top: var(--wp--preset--spacing--10);
padding-bottom: var(--wp--preset--spacing--10);
}

.is-style-arrow-icon-details summary {
list-style-type: "\2193\00a0\00a0\00a0";
}

.is-style-arrow-icon-details[open]>summary {
list-style-type: "\2192\00a0\00a0\00a0";
}',
)
);
register_block_style(
'core/post-terms',
array(
'name' => 'pill',
'label' => __( 'Pill', 'twentytwentyfour' ),
/*
* Styles variation for post terms
* https://github.com/WordPress/gutenberg/issues/24956
*/
'inline_style' => '
.is-style-pill a,
.is-style-pill span:not([class], [data-rich-text-placeholder]) {
display: inline-block;
background-color: var(--wp--preset--color--base-2);
padding: 0.375rem 0.875rem;
border-radius: var(--wp--preset--spacing--20);
}

.is-style-pill a:hover {
background-color: var(--wp--preset--color--contrast-3);
}',
)
);
register_block_style(
'core/list',
array(
'name' => 'checkmark-list',
'label' => __( 'Checkmark', 'twentytwentyfour' ),
/*
* Styles for the custom checkmark list block style
* https://github.com/WordPress/gutenberg/issues/51480
*/
'inline_style' => '
ul.is-style-checkmark-list {
list-style-type: "\2713";
}

ul.is-style-checkmark-list li {
padding-inline-start: 1ch;
}',
)
);
register_block_style(
'core/navigation-link',
array(
'name' => 'arrow-link',
'label' => __( 'With arrow', 'twentytwentyfour' ),
/*
* Styles for the custom arrow nav link block style
*/
'inline_style' => '
.is-style-arrow-link .wp-block-navigation-item__label:after {
content: "\2197";
padding-inline-start: 0.25rem;
vertical-align: middle;
text-decoration: none;
display: inline-block;
}',
)
);
register_block_style(
'core/heading',
array(
'name' => 'asterisk',
'label' => __( 'With asterisk', 'twentytwentyfour' ),
'inline_style' => "
.is-style-asterisk:before {
content: '';
width: 1.5rem;
height: 3rem;
background: var(--wp--preset--color--contrast-2, currentColor);
clip-path: path('M11.93.684v8.039l5.633-5.633 1.216 1.23-5.66 5.66h8.04v1.737H13.2l5.701 5.701-1.23 1.23-5.742-5.742V21h-1.737v-8.094l-5.77 5.77-1.23-1.217 5.743-5.742H.842V9.98h8.162l-5.701-5.7 1.23-1.231 5.66 5.66V.684h1.737Z');
display: block;
}

/* Hide the asterisk if the heading has no content, to avoid using empty headings to display the asterisk only, which is an A11Y issue */
.is-style-asterisk:empty:before {
content: none;
}

.is-style-asterisk:-moz-only-whitespace:before {
content: none;
}

.is-style-asterisk.has-text-align-center:before {
margin: 0 auto;
}

.is-style-asterisk.has-text-align-right:before {
margin-left: auto;
}

.rtl .is-style-asterisk.has-text-align-left:before {
margin-right: auto;
}",
)
);
}
endif;

add_action( 'init', 'twentytwentyfour_block_styles' );

/**
* Enqueue block stylesheets.
*/

if ( ! function_exists( 'twentytwentyfour_block_stylesheets' ) ) :
/**
* Enqueue custom block stylesheets
*
* @since Twenty Twenty-Four 1.0
* @return void
*/
function twentytwentyfour_block_stylesheets() {
/**
* The wp_enqueue_block_style() function allows us to enqueue a stylesheet
* for a specific block. These will only get loaded when the block is rendered
* (both in the editor and on the front end), improving performance
* and reducing the amount of data requested by visitors.
*
* See https://make.wordpress.org/core/2021/12/15/using-multiple-stylesheets-per-block/ for more info.
*/
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'twentytwentyfour-button-style-outline',
'src' => get_parent_theme_file_uri( 'assets/css/button-outline.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/button-outline.css' ),
)
);
}
endif;

add_action( 'init', 'twentytwentyfour_block_stylesheets' );

/**
* Register pattern categories.
*/

if ( ! function_exists( 'twentytwentyfour_pattern_categories' ) ) :
/**
* Register pattern categories
*
* @since Twenty Twenty-Four 1.0
* @return void
*/
function twentytwentyfour_pattern_categories() {

register_block_pattern_category(
'twentytwentyfour_page',
array(
'label' => _x( 'Pages', 'Block pattern category', 'twentytwentyfour' ),
'description' => __( 'A collection of full page layouts.', 'twentytwentyfour' ),
)
);
}
endif;

add_action( 'init', 'twentytwentyfour_pattern_categories' );
1 change: 1 addition & 0 deletions twentytwentyfour/parts/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"twentytwentyfour/footer"} /-->
26 changes: 26 additions & 0 deletions twentytwentyfour/parts/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"20px","bottom":"20px"}}},"backgroundColor":"base","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignwide has-base-background-color has-background"
style="padding-top:20px;padding-bottom:20px">
<!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between","flexWrap":"wrap"}} -->
<div class="wp-block-group alignwide">
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}},"layout":{"type":"flex"}} -->
<div class="wp-block-group">
<!-- wp:site-logo {"width":60 } /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}}} -->
<div class="wp-block-group">
<!-- wp:site-title {"level":0} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:group {"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"left"}} -->
<div class="wp-block-group">
<!-- wp:navigation {"layout":{"type":"flex","justifyContent":"right","orientation":"horizontal"},"style":{"spacing":{"margin":{"top":"0"},"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}}} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->
1 change: 1 addition & 0 deletions twentytwentyfour/parts/post-meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"twentytwentyfour/hidden-post-meta"} /-->
1 change: 1 addition & 0 deletions twentytwentyfour/parts/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"twentytwentyfour/hidden-sidebar"} /-->
55 changes: 55 additions & 0 deletions twentytwentyfour/patterns/banner-hero.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/**
* Title: Hero
* Slug: twentytwentyfour/banner-hero
* Categories: banner, call-to-action, featured
* Viewport width: 1400
*/
?>

<!-- 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"}}},"layout":{"type":"constrained","contentSize":"","wideSize":""}} -->
<div class="wp-block-group alignfull" style="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)">

<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}},"layout":{"type":"constrained","contentSize":"565px"}} -->
<div class="wp-block-group">

<!-- wp:heading {"textAlign":"center","fontSize":"x-large","level":1} -->
<h1 class="wp-block-heading has-text-align-center has-x-large-font-size"><?php echo esc_html_x( 'A commitment to innovation and sustainability', 'Heading of the hero section', 'twentytwentyfour' ); ?></h1>
<!-- /wp:heading -->

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

<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center"><?php echo esc_html_x( 'Études is a pioneering firm that seamlessly merges creativity and functionality to redefine architectural excellence.', 'Content of the hero section', 'twentytwentyfour' ); ?></p>
<!-- /wp:paragraph -->

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

<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
<div class="wp-block-buttons">
<!-- wp:button -->
<div class="wp-block-button">
<a class="wp-block-button__link wp-element-button"><?php echo esc_html_x( 'About us', 'Button text of the hero section', 'twentytwentyfour' ); ?></a>
</div>
<!-- /wp:button -->
</div>
<!-- /wp:buttons -->
</div>
<!-- /wp:group -->

<!-- wp:spacer {"height":"var:preset|spacing|30","style":{"layout":{}}} -->
<div style="height:var(--wp--preset--spacing--30)" aria-hidden="true" class="wp-block-spacer">
</div>
<!-- /wp:spacer -->

<!-- wp:image {"align":"wide","sizeSlug":"full","linkDestination":"none","className":"is-style-rounded"} -->
<figure class="wp-block-image alignwide size-full is-style-rounded">
<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/images/building-exterior.webp" alt="<?php esc_attr_e( 'Building exterior in Toronto, Canada', 'twentytwentyfour' ); ?>" />
</figure>
<!-- /wp:image -->
</div>
<!-- /wp:group -->
44 changes: 44 additions & 0 deletions twentytwentyfour/patterns/banner-project-description.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Title: Project description
* Slug: twentytwentyfour/banner-project-description
* Categories: featured, banner, about, portfolio
* Viewport width: 1400
*/
?>
<!-- wp:group {"align":"full","style":{"spacing":{"margin":{"top":"0","bottom":"0"},"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"backgroundColor":"accent-2","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull has-accent-2-background-color has-background" 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)">
<!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide">
<!-- wp:column {"width":"40%"} -->
<div class="wp-block-column" style="flex-basis:40%">
<!-- wp:paragraph {"style":{"layout":{"selfStretch":"fixed","flexSize":"50%"}}} -->
<p><?php echo esc_html_x( 'Art Gallery — Overview', 'Sample title for a project or post', 'twentytwentyfour' ); ?></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:column -->

<!-- wp:column {"width":"60%"} -->
<div class="wp-block-column" style="flex-basis:60%">

<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"x-large","fontFamily":"heading"} -->
<p class="has-heading-font-family has-x-large-font-size" style="line-height:1.2"><?php echo esc_html_x( 'This transformative project seeks to enhance the gallery\'s infrastructure, accessibility, and exhibition spaces while preserving its rich cultural heritage.', 'Sample descriptive text for a project or post.', 'twentytwentyfour' ); ?></p>
<!-- /wp:paragraph -->

</div>
<!-- /wp:column -->
</div>
<!-- /wp:columns -->

<!-- wp:spacer {"height":"var:preset|spacing|40"} -->
<div style="height:var(--wp--preset--spacing--40)" aria-hidden="true" class="wp-block-spacer">
</div>
<!-- /wp:spacer -->

<!-- wp:image {"align":"wide","sizeSlug":"large","linkDestination":"none","className":"is-style-rounded"} -->
<figure class="wp-block-image alignwide size-large is-style-rounded">
<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/images/hotel-facade.webp" alt="<?php esc_attr_e( 'Hyatt Regency San Francisco, San Francisco, United States', 'twentytwentyfour' ); ?>" />
</figure>
<!-- /wp:image -->
</div>
<!-- /wp:group -->
Loading
Loading