Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/test-and-zip-default-themes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
fail-fast: false
matrix:
theme: [
'ipsum',
'twentytwentyfive',
'twentytwentyfour',
'twentytwentythree',
Expand Down Expand Up @@ -224,6 +225,7 @@ jobs:
fail-fast: false
matrix:
theme: [
'ipsum',
'twentytwentyfive',
'twentytwentyfour',
'twentytwentythree',
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ wp-tests-config.php
!/src/wp-content/themes/twentytwentythree
!/src/wp-content/themes/twentytwentyfour
!/src/wp-content/themes/twentytwentyfive
!/src/wp-content/themes/ipsum
/src/wp-content/upgrade
/src/wp-content/uploads
/src/wp-content/advanced-cache.php
Expand Down
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = function(grunt) {
'wp-content/index.php',
'wp-content/themes/index.php',
'wp-content/themes/twenty*/**',
'wp-content/themes/ipsum/**',
'wp-content/plugins/index.php',
'wp-content/plugins/hello.php',
'wp-content/plugins/akismet/**',
Expand Down Expand Up @@ -1715,7 +1716,7 @@ module.exports = function(grunt) {
if( grunt.option( 'minimal-copy' ) ) {
var copyFilesOptions = grunt.config.get( 'copy.files.files' );
copyFilesOptions[0].src.push( '!wp-content/plugins/**' );
copyFilesOptions[0].src.push( '!wp-content/themes/!(twenty*)/**' );
copyFilesOptions[0].src.push( '!wp-content/themes/!(twenty*|ipsum)/**' );
grunt.config.set( 'copy.files.files', copyFilesOptions );
}

Expand Down
4 changes: 2 additions & 2 deletions phpcompat.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
<!-- Exclude plugins. -->
<exclude-pattern>/src/wp-content/plugins/*</exclude-pattern>

<!-- Exclude themes except the twenty* themes. -->
<exclude-pattern>/src/wp-content/themes/(?!twenty)*</exclude-pattern>
<!-- Exclude themes except the twenty* themes and Ipsum. -->
<exclude-pattern>/src/wp-content/themes/(?!twenty|ipsum)*</exclude-pattern>

<!-- Exclude translation files. -->
<exclude-pattern>/src/wp-content/languages/*</exclude-pattern>
Expand Down
4 changes: 2 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
<!-- Plugins. -->
<exclude-pattern>/src/wp-content/plugins/*</exclude-pattern>

<!-- Themes except the twenty* themes. -->
<exclude-pattern>/src/wp-content/themes/(?!twenty)*</exclude-pattern>
<!-- Themes except the twenty* themes and Ipsum. -->
<exclude-pattern>/src/wp-content/themes/(?!twenty|ipsum)*</exclude-pattern>

<!-- Translation files. -->
<exclude-pattern>/src/wp-content/languages/*</exclude-pattern>
Expand Down
1 change: 1 addition & 0 deletions src/wp-admin/includes/update-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,7 @@
'themes/twentytwentythree/' => '6.1',
'themes/twentytwentyfour/' => '6.4',
'themes/twentytwentyfive/' => '6.7',
'themes/ipsum/' => '7.2',
);

/**
Expand Down
11 changes: 11 additions & 0 deletions src/wp-content/themes/ipsum/assets/css/editor-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Editor-only overrides. The editors load style.css first, so this file holds
* only what the editors need on top of it.
*
* Sticky header part and pinned search bar: !important because the editor
* forces position:relative on block wrappers.
*/
header.wp-block-template-part:has(> .is-position-sticky),
.sticky-bottom {
position: sticky !important;
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
208 changes: 208 additions & 0 deletions src/wp-content/themes/ipsum/functions.php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few naming things suggestions for this file. I don't think they block the initial commit but would be good to change prior to the production release.

The key word above is suggestions, feel free to push back:

  • ipsum_register_editor_styles
  • ipsum_add_theme_support
  • ipsum_enqueue_styles
  • ipsum_register_block_styles

Nitty nit nit pick: as I say, feel free to push back :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
<?php
/**
* Ipsum functions and definitions.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Ipsum
* @since Ipsum 1.0
*/

// Loads style.css in the editors too, then the few overrides only the editors need.
if ( ! function_exists( 'ipsum_register_editor_styles' ) ) :
/**
* Adds style.css and editor-style.css as editor stylesheets.
*
* @since Ipsum 1.0
*
* @return void
*/
function ipsum_register_editor_styles() {
add_editor_style( array( 'style.css', 'assets/css/editor-style.css' ) );
}
endif;
add_action( 'after_setup_theme', 'ipsum_register_editor_styles' );

if ( ! function_exists( 'ipsum_add_theme_support' ) ) :
/**
* Adds HTML5 support for navigation widgets, so their lists render inside a
* nav element. Block themes already get core's other HTML5 features, and this
* call merges with them.
*
* @since Ipsum 1.0
*
* @return void
*/
function ipsum_add_theme_support() {
add_theme_support( 'html5', array( 'navigation-widgets' ) );
}
endif;
add_action( 'after_setup_theme', 'ipsum_add_theme_support' );

if ( ! function_exists( 'ipsum_enqueue_styles' ) ) :
/**
* Enqueues styles.
*
* @since Ipsum 1.0
*
* @return void
*/
function ipsum_enqueue_styles() {
// Register theme stylesheet.
wp_register_style(
'ipsum-style',
get_parent_theme_file_uri( 'style.css' ),
array(),
wp_get_theme()->get( 'Version' )
);

// Enqueue theme stylesheet.
wp_enqueue_style( 'ipsum-style' );
}
endif;
add_action( 'wp_enqueue_scripts', 'ipsum_enqueue_styles' );

if ( ! function_exists( 'ipsum_comments_cta_binding' ) ) :
/**
* Returns the comments call to action for the current post.
*
* @since Ipsum 1.0
*
* @param array $source_args Block binding source arguments.
* @param WP_Block $block_instance The block instance.
* @return string The call to action text.
*/
function ipsum_comments_cta_binding( $source_args, $block_instance ) {
$post_id = $block_instance->context['postId'] ?? get_the_ID();

if ( get_comments_number( $post_id ) > 0 ) {
$text = __( 'Join the conversation', 'ipsum' );
} else {
$text = __( 'Be the first to comment', 'ipsum' );
}

return '<a href="' . esc_url( get_comments_link( $post_id ) ) . '">' . esc_html( $text ) . '</a>';
}
endif;

if ( ! function_exists( 'ipsum_register_block_bindings' ) ) :
/**
* Registers the comments call-to-action block binding source.
*
* @since Ipsum 1.0
*
* @return void
*/
function ipsum_register_block_bindings() {
register_block_bindings_source(
'ipsum/comments-cta',
array(
'label' => __( 'Comments call to action', 'ipsum' ),
'get_value_callback' => 'ipsum_comments_cta_binding',
'uses_context' => array( 'postId' ),
)
);
}
endif;
add_action( 'init', 'ipsum_register_block_bindings' );

if ( ! function_exists( 'ipsum_sidebar_template_types' ) ) :
/**
* Registers the sidebar template variants as template types, so they are
* listed with proper titles and descriptions in the Site Editor.
*
* @since Ipsum 1.0
*
* @param array $default_template_types The default template types.
* @return array The template types, with the sidebar variants added.
*/
function ipsum_sidebar_template_types( $default_template_types ) {
$default_template_types['index-sidebar'] = array(
'title' => _x( 'Index Sidebar', 'Template name', 'ipsum' ),
'description' => __( 'Displays the latest posts beside a sidebar with categories and recent posts.', 'ipsum' ),
);
$default_template_types['archive-sidebar'] = array(
'title' => _x( 'All Archives Sidebar', 'Template name', 'ipsum' ),
'description' => __( 'Displays post archives beside a sidebar with categories and recent posts.', 'ipsum' ),
);
return $default_template_types;
}
endif;
add_filter( 'default_template_types', 'ipsum_sidebar_template_types' );

if ( ! function_exists( 'ipsum_register_pattern_categories' ) ) :
/**
* Registers the pattern categories the theme's patterns use beyond core's.
*
* @since Ipsum 1.0
*
* @return void
*/
function ipsum_register_pattern_categories() {
register_block_pattern_category(
'ipsum_page',
array(
'label' => _x( 'Pages', 'Block pattern category', 'ipsum' ),
'description' => __( 'Full page layouts, ready to be applied to a page.', 'ipsum' ),
)
);
}
endif;
add_action( 'init', 'ipsum_register_pattern_categories' );

if ( ! function_exists( 'ipsum_search_aria_label_support' ) ) :
/**
* Lets the Search block take an ARIA label, so its search landmark can be named.
*
* Every Search block is a search landmark, and a page can hold more than one,
* such as the search bar next to the search call to action, or next to the
* search in the navigation overlay. Repeated landmarks need unique names, but
* the block has no ariaLabel support of its own, so this turns on core's and
* the patterns set the name.
*
* @since Ipsum 1.0
*
* @param array $metadata Metadata for the block type being registered.
* @return array The block metadata, with ARIA label support on the Search block.
*/
function ipsum_search_aria_label_support( $metadata ) {
if ( isset( $metadata['name'] ) && 'core/search' === $metadata['name'] ) {
$metadata['supports']['ariaLabel'] = true;
}
return $metadata;
}
endif;
add_filter( 'block_type_metadata', 'ipsum_search_aria_label_support' );

if ( ! function_exists( 'ipsum_register_block_styles' ) ) :
/**
* Registers block style variations.
*
* The Evening code style keeps the Evening palette's literals on purpose,
* so the block reads as a dark slab under every style variation.
*
* @since Ipsum 1.0
*
* @return void
*/
function ipsum_register_block_styles() {
register_block_style(
'core/code',
array(
'name' => 'evening',
'label' => _x( 'Evening', 'Block style label', 'ipsum' ),
'inline_style' => '.wp-block-code.is-style-evening{background-color:#000000;color:#fafafa;border-color:#fafafa40;}',
)
);

register_block_style(
'core/site-logo',
array(
'name' => 'sharp',
'label' => _x( 'Sharp', 'Block style label', 'ipsum' ),
'inline_style' => '.wp-block-site-logo.is-style-sharp{border-radius:0;}',
)
);
}
endif;
add_action( 'init', 'ipsum_register_block_styles' );
1 change: 1 addition & 0 deletions src/wp-content/themes/ipsum/parts/footer-wide.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"ipsum/footer-wide"} /-->
1 change: 1 addition & 0 deletions src/wp-content/themes/ipsum/parts/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"ipsum/footer"} /-->
1 change: 1 addition & 0 deletions src/wp-content/themes/ipsum/parts/header-collapsed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"ipsum/header-collapsed"} /-->
1 change: 1 addition & 0 deletions src/wp-content/themes/ipsum/parts/header-sticky.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"ipsum/header-sticky"} /-->
1 change: 1 addition & 0 deletions src/wp-content/themes/ipsum/parts/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"ipsum/header-default"} /-->
1 change: 1 addition & 0 deletions src/wp-content/themes/ipsum/parts/navigation-overlay.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"ipsum/navigation-overlay"} /-->
1 change: 1 addition & 0 deletions src/wp-content/themes/ipsum/parts/search-bar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"ipsum/hidden-search-bar"} /-->
1 change: 1 addition & 0 deletions src/wp-content/themes/ipsum/parts/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"ipsum/hidden-sidebar"} /-->
36 changes: 36 additions & 0 deletions src/wp-content/themes/ipsum/patterns/about-row.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Title: About Row
* Slug: ipsum/about-row
* Categories: about
* Viewport width: 1280
* Description: An about section on a dark band — the blog’s story beside the author’s square portrait, under a fit-text heading.
*
* @package Ipsum
* @since Ipsum 1.0
*/

?>
<!-- wp:group {"metadata":{"name":"<?php echo esc_html_x( 'About Row', 'Name of the about row group', 'ipsum' ); ?>"},"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|theme-1"}}},"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"},"margin":{"top":"0","bottom":"0"}}},"backgroundColor":"theme-6","textColor":"theme-1","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull has-theme-1-color has-theme-6-background-color has-text-color has-background has-link-color" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50)"><!-- wp:columns {"verticalAlignment":"bottom","align":"wide","style":{"spacing":{"blockGap":{"top":"var:preset|spacing|60","left":"var:preset|spacing|80"}}}} -->
<div class="wp-block-columns alignwide are-vertically-aligned-bottom"><!-- wp:column {"verticalAlignment":"bottom","width":"50%"} -->
<div class="wp-block-column is-vertically-aligned-bottom" style="flex-basis:50%"><!-- wp:heading {"fitText":true} -->
<h2 class="wp-block-heading has-fit-text"><?php esc_html_e( 'About this blog', 'ipsum' ); ?></h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"fontSize":"medium"} -->
<p class="has-medium-font-size"><?php esc_html_e( 'This blog belongs to Lorem—teacher by day, keeper of a quiet corner of the web by night. It runs on three sections: essays that take their time, pictures standing in for the hours between posts, and the occasional sound worth pressing play on.', 'ipsum' ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"fontSize":"medium"} -->
<p class="has-medium-font-size"><?php esc_html_e( 'Nothing here is optimized, scheduled, or sponsored; posts appear when they’re ready and stay up long after the trends move on. The name is borrowed from the oldest placeholder in publishing, and the page tries to live up to it—holding its shape until your own words move in.', 'ipsum' ); ?></p>
<!-- /wp:paragraph --></div>
<!-- /wp:column -->

<!-- wp:column {"verticalAlignment":"bottom","width":"50%","layout":{"type":"default"}} -->
<div class="wp-block-column is-vertically-aligned-bottom" style="flex-basis:50%"><!-- wp:image {"aspectRatio":"1","scale":"cover","sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/images/ipsum-portrait-editorial.webp?ver=<?php echo esc_attr( wp_get_theme( get_template() )->get( 'Version' ) ); ?>" alt="<?php esc_attr_e( 'Portrait of the author.', 'ipsum' ); ?>" style="aspect-ratio:1;object-fit:cover"/></figure>
<!-- /wp:image --></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->
43 changes: 43 additions & 0 deletions src/wp-content/themes/ipsum/patterns/archive-columns.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Title: Archive Columns
* Slug: ipsum/archive-columns
* Categories: posts
* Block Types: core/query
* Viewport width: 1280
* Description: Featured image beside title and meta in a responsive row — the image takes a fixed width on desktop and the full width on small screens.
*
* @package Ipsum
* @since Ipsum 1.0
*/

?>
<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"taxQuery":null,"parents":[],"excludeCurrent":null},"metadata":{"categories":["posts"],"name":"<?php echo esc_html_x( 'Archive Columns', 'Name of the Archive Columns query', 'ipsum' ); ?>"},"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-query alignwide"><!-- wp:post-template {"style":{"spacing":{"blockGap":"var:preset|spacing|60"}},"layout":{"type":"constrained"}} -->
<!-- wp:group {"metadata":{"name":"<?php echo esc_html_x( 'Media and Content', 'Name of the group holding the media and content', 'ipsum' ); ?>"},"style":{"@mobile":{"layout":{"orientation":"vertical","justifyContent":"stretch"}},"@tablet":{"layout":{"orientation":"vertical","justifyContent":"stretch"}},"spacing":{"blockGap":"var:preset|spacing|40"}},"layout":{"type":"flex","flexWrap":"nowrap","verticalAlignment":"top"}} -->
<div class="wp-block-group"><!-- wp:post-featured-image {"isLink":true,"aspectRatio":"4/3","sizeSlug":"large","style":{"@mobile":{"layout":{"selfStretch":"fit"}},"@tablet":{"layout":{"selfStretch":"fit"}},"layout":{"selfStretch":"fixedNoShrink","flexSize":"300px"}}} /-->

<!-- wp:group {"metadata":{"name":"<?php echo esc_html_x( 'Title and Meta', 'Name of the group holding the post title and meta', 'ipsum' ); ?>"},"style":{"layout":{"selfStretch":"fill"},"spacing":{"blockGap":"var:preset|spacing|30"}},"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:post-title {"isLink":true,"fontSize":"large"} /-->

<!-- wp:post-date {"isLink":true,"style":{"typography":{"fontStyle":"normal","fontWeight":"400"}}} /--></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
<!-- /wp:post-template -->

<!-- wp:group {"metadata":{"name":"<?php echo esc_html_x( 'No Results Wrapper', 'Name of the group shown when a query has no results', 'ipsum' ); ?>"},"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:query-no-results -->
<!-- wp:paragraph -->
<p><?php esc_html_e( 'No posts have been published in this section yet.', 'ipsum' ); ?></p>
<!-- /wp:paragraph -->
<!-- /wp:query-no-results --></div>
<!-- /wp:group -->

<!-- wp:group {"metadata":{"name":"<?php echo esc_html_x( 'Pagination Wrapper', 'Name of the group wrapping the pagination', 'ipsum' ); ?>"},"align":"wide","style":{"spacing":{"margin":{"top":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignwide" style="margin-top:var(--wp--preset--spacing--60)"><!-- wp:query-pagination {"paginationArrow":"arrow","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->

<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination --></div>
<!-- /wp:group --></div>
<!-- /wp:query -->
Loading
Loading