Making WordPress.org

Changeset 14145


Ignore:
Timestamp:
10/25/2024 02:05:46 AM (19 months ago)
Author:
adamwood
Message:

Breathe 2024: Fix issues with heading hierarchy

See https://github.com/WordPress/wordpress.org/issues/389
See https://github.com/WordPress/wordpress.org/issues/382

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024/functions.php

    r14116 r14145  
    637637}
    638638add_filter( 'render_block_core/search', __NAMESPACE__ . '\modify_handbook_search_block_action', 10, 2 );
     639
     640/**
     641 * Display navigation to next/previous pages when applicable
     642 * Customized to fix issues with heading hierarchy.
     643 */
     644function breathe_content_nav( $nav_id ) {
     645    global $wp_query, $post;
     646
     647    // Don't print empty markup on single pages if there's nowhere to navigate.
     648    if ( is_single() ) {
     649        $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
     650        $next = get_adjacent_post( false, '', false );
     651
     652        if ( ! $next && ! $previous )
     653            return;
     654    }
     655
     656    // Don't print empty markup in archives if there's only one page.
     657    if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) )
     658        return;
     659
     660    $nav_class = ( is_single() ) ? 'navigation-post' : 'navigation-paging';
     661
     662    ?>
     663    <nav role="navigation" id="<?php echo esc_attr( $nav_id ); ?>" class="<?php echo $nav_class; ?>">
     664        <h2 class="screen-reader-text"><?php _e( 'Post navigation', 'p2-breathe' ); ?></h2>
     665
     666    <?php if ( is_single() ) : // navigation links for single posts ?>
     667
     668        <?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'p2-breathe' ) . '</span> %title' ); ?>
     669        <?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'p2-breathe' ) . '</span>' ); ?>
     670
     671    <?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?>
     672
     673        <?php if ( get_next_posts_link() ) : ?>
     674        <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'p2-breathe' ) ); ?></div>
     675        <?php endif; ?>
     676
     677        <?php if ( get_previous_posts_link() ) : ?>
     678        <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'p2-breathe' ) ); ?></div>
     679        <?php endif; ?>
     680
     681    <?php endif; ?>
     682
     683    </nav><!-- #<?php echo esc_html( $nav_id ); ?> -->
     684    <?php
     685}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024/sidebar.php

    r14020 r14145  
    1111    <div id="primary-modal"></div>
    1212    <div id="secondary" class="widget-area" role="complementary">
     13        <h2 class="screen-reader-text"><?php esc_html_e( 'Site resources', 'wporg' ); ?></h2>
    1314        <a href="#" id="secondary-toggle"><button aria-label="Close menu" class="wp-block-navigation__responsive-container-close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg></button></a>
    1415        <div id="secondary-content">
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024/single-handbook.php

    r14020 r14145  
    99
    1010<?php $is_landing_page = wporg_is_handbook_landing_page(); ?>
    11 
    12 <?php get_sidebar( 'handbook' ); ?>
    1311
    1412<?php if ( 'handbook' !== wporg_get_current_handbook() ) { ?>
     
    5755</div> <!-- #primary -->
    5856
     57<?php get_sidebar( 'handbook' ); ?>
     58
    5959<?php get_footer(); ?>
    6060
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024/style.css

    r14139 r14145  
    916916    padding: 0;
    917917    text-transform: none;
    918 }
    919 
    920 .o2-app-page-title a {
    921     color: #0072a9;
    922 }
    923 .o2-app-page-title a:visited {
    924     color: #4ca6cf;
    925 }
    926 
    927 .home .o2-app-page-title {
    928     display: none;
     918    color: inherit;
    929919}
    930920
     
    10991089.o2-xpost-author {
    11001090    margin: 5px 0 0 0;
    1101     line-height: 1.3;
    11021091}
    11031092
     
    11081097.o2-xpost-author .entry-date {
    11091098    padding-left: unset;
     1099}
     1100
     1101h2.o2-xpost-content {
     1102    font-size: var(--wp--preset--font-size--normal) !important;
     1103    font-weight: 400;
     1104    text-wrap: pretty;
     1105    line-height: var(--wp--custom--body--short-text--typography--line-height) !important;
    11101106}
    11111107 
Note: See TracChangeset for help on using the changeset viewer.