diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/functions.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/functions.php index defe6bc2..a7ec5ae6 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/functions.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/functions.php @@ -34,6 +34,7 @@ add_action( 'wp_head', __NAMESPACE__ . '\add_social_meta_tags', 5 ); add_filter( 'document_title_parts', __NAMESPACE__ . '\set_document_title' ); add_filter( 'body_class', __NAMESPACE__ . '\add_status_body_class' ); +add_filter( 'frontpage_template_hierarchy', __NAMESPACE__ . '\use_archive_template_paged' ); add_action( 'init', @@ -426,12 +427,12 @@ function user_has_flagged_pattern() { * Redirect category and tag archives to their canonical URLs. * * This prevents double URLs for every category/tag, e.g., - * `/archives/?pattern-categories=footer` and `/categories/footer/`. + * `/?pattern-categories=footer` and `/categories/footer/`. */ function redirect_term_archives() { global $wp_query; $terms = get_applied_filter_list( false ); - // True on the `/tag/…` URLs, and false on `/archive/?tag…` URLs. + // True on the `/tag/…` URLs, and false on `/?tag…` URLs. $is_term_archive = is_tag() || is_category() || is_tax(); // Don't redirect on favorites or author archives. @@ -577,3 +578,15 @@ function add_status_body_class( $classes ) { } return $classes; } + +/** + * Switch to the archive.html template on paged requests. + * + * @param string[] $templates A list of template candidates, in descending order of priority. + */ +function use_archive_template_paged( $templates ) { + if ( is_paged() ) { + array_unshift( $templates, 'archive.html' ); + } + return $templates; +} diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php index f96e4b95..73bccfe0 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php @@ -105,7 +105,7 @@ function get_filter_action_url() { if ( is_page( 'favorites' ) || is_page( 'my-patterns' ) || is_author() ) { return home_url( $wp->request ); } - return home_url( '/archives/' ); + return home_url( '/' ); } /** @@ -384,7 +384,7 @@ function add_site_navigation_menus( $menus ) { } $all_link = array( 'label' => __( 'All', 'wporg-patterns' ), - 'url' => is_page( 'favorites' ) || is_author() ? home_url( $wp->request ) : home_url( '/archives/' ), + 'url' => is_page( 'favorites' ) || is_author() ? home_url( $wp->request ) : home_url( '/' ), 'className' => empty( $current_cats ) ? 'current-menu-item' : '', ); array_unshift( $categories, $all_link ); @@ -473,12 +473,7 @@ function update_site_breadcrumbs( $breadcrumbs ) { $term_names = get_applied_filter_list( false ); // Build up the breadcrumbs from scratch. - $breadcrumbs = array( - array( - 'url' => home_url(), - 'title' => __( 'Home', 'wporg-patterns' ), - ), - ); + $breadcrumbs = array(); if ( is_page() || is_single() ) { $breadcrumbs[] = array( @@ -505,7 +500,7 @@ function update_site_breadcrumbs( $breadcrumbs ) { if ( is_search() ) { $breadcrumbs[] = array( - 'url' => home_url( '/archives/' ), + 'url' => home_url( '/' ), 'title' => __( 'All patterns', 'wporg-patterns' ), ); $breadcrumbs[] = array( @@ -521,7 +516,7 @@ function update_site_breadcrumbs( $breadcrumbs ) { $author = isset( $wp_query->query['author_name'] ) ? get_user_by( 'slug', $wp_query->query['author_name'] ) : false; $breadcrumbs[] = array( - 'url' => home_url( '/archives/' ), + 'url' => home_url( '/' ), 'title' => __( 'All patterns', 'wporg-patterns' ), ); diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid-front-page.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid-front-page.php deleted file mode 100644 index 3b58b2a7..00000000 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid-front-page.php +++ /dev/null @@ -1,65 +0,0 @@ - - -
- - - -
- -
- - - -
- - - -
- - -
- -
- - - - - - - - -
- - - -
- - - -
- -
- - -
- - - - - - - - - diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid.php index 592071c2..f4bc7be2 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid.php @@ -68,9 +68,9 @@

all patterns or try a different search. ', 'wporg-patterns' ) ), - esc_url( home_url( '/archives/' ) ) + esc_url( home_url( '/' ) ) ); ?>

diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/style.css b/public_html/wp-content/themes/wporg-pattern-directory-2024/style.css index c572ad3c..fceb2d84 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/style.css +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/style.css @@ -48,6 +48,11 @@ body.page .wp-block-wporg-local-navigation-bar .wp-block-query-title { display: none; } +/* Hide the grid `h1` on the homepage, as the header has an h1. */ +body.blog:not(.paged) .wp-block-query .wp-block-query-title { + display: none; +} + /* * A linked post title should be blueberry (needed to override parent setting, * where post title is the same for linked or not). diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/archive.html b/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/archive.html index d8c48c97..4f74ca86 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/archive.html +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/archive.html @@ -18,4 +18,4 @@ - \ No newline at end of file + diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/front-page.html b/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/front-page.html index 6e2ac674..a9787d6f 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/front-page.html +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/front-page.html @@ -3,9 +3,9 @@
- -
- + +
+
diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/index.html b/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/index.html index d8c48c97..4f74ca86 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/index.html +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/templates/index.html @@ -18,4 +18,4 @@
- \ No newline at end of file +