diff --git a/source/wp-content/themes/wporg-showcase-2022/functions.php b/source/wp-content/themes/wporg-showcase-2022/functions.php index b2e25778..12fc9a78 100644 --- a/source/wp-content/themes/wporg-showcase-2022/functions.php +++ b/source/wp-content/themes/wporg-showcase-2022/functions.php @@ -16,6 +16,7 @@ add_action( 'wp', __NAMESPACE__ . '\jetpackme_remove_rp', 20 ); add_filter( 'excerpt_length', __NAMESPACE__ . '\modify_excerpt_length', 999 ); add_filter( 'excerpt_more', __NAMESPACE__ . '\modify_excerpt_more' ); +add_filter( 'query_loop_block_query_vars', __NAMESPACE__ . '\modify_query_loop_block_query_vars', 10, 2 ); /** * Enqueue scripts and styles. @@ -154,3 +155,20 @@ function modify_excerpt_length() { function modify_excerpt_more() { return '...'; } + +/** + * Modify query vars for mast head query. + * + * See: https://github.com/WordPress/gutenberg/issues/41184 + * + * @return string + */ +function modify_query_loop_block_query_vars( $query, $block ) { + if ( isset( $block->context['query']['sticky'] ) && 'only' === $block->context['query']['sticky'] ) { + $sticky = get_option( 'sticky_posts' ); + $query['ignore_sticky_posts'] = 1; + $query['post__in'] = $sticky; + } + + return $query; +} diff --git a/source/wp-content/themes/wporg-showcase-2022/images/showcase.svg b/source/wp-content/themes/wporg-showcase-2022/images/showcase.svg new file mode 100644 index 00000000..26e87041 --- /dev/null +++ b/source/wp-content/themes/wporg-showcase-2022/images/showcase.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/source/wp-content/themes/wporg-showcase-2022/patterns/front-page.php b/source/wp-content/themes/wporg-showcase-2022/patterns/front-page.php index 3afc8e86..3d6fe41f 100644 --- a/source/wp-content/themes/wporg-showcase-2022/patterns/front-page.php +++ b/source/wp-content/themes/wporg-showcase-2022/patterns/front-page.php @@ -7,8 +7,44 @@ ?> - -