feat: define compact CHRNX header controls
This commit is contained in:
5 files changed
+100
-6
No files matched your search
@@ -8,6 +8,5 @@
|
||||
"description": "Display translated primary navigation and progressive site search.",
|
||||
"textdomain": "chrnx",
|
||||
"supports": { "html": false },
|
||||
"viewScript": "file:../../assets/js/search.js",
|
||||
"render": "file:./render.php"
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
* @package CHRNX
|
||||
*/
|
||||
|
||||
$chrnx_header_links = array(
|
||||
$chrnx_header_links = array(
|
||||
array(
|
||||
'label' => __( 'Journal', 'chrnx' ),
|
||||
'url' => home_url( '/journal/' ),
|
||||
@@ -27,8 +27,9 @@ $chrnx_header_links = array(
|
||||
'url' => home_url( '/about/' ),
|
||||
),
|
||||
);
|
||||
$chrnx_search_label = __( 'Search', 'chrnx' );
|
||||
$chrnx_search_id = wp_unique_id( 'chrnx-search-' );
|
||||
$chrnx_search_label = __( 'Search', 'chrnx' );
|
||||
$chrnx_search_id = wp_unique_id( 'chrnx-search-' );
|
||||
$chrnx_search_panel_id = wp_unique_id( 'chrnx-search-panel-' );
|
||||
?>
|
||||
<nav id="chrnx-primary-navigation" class="chrnx-primary-navigation" aria-label="<?php echo esc_attr__( 'Primary navigation', 'chrnx' ); ?>">
|
||||
<ul>
|
||||
@@ -38,11 +39,15 @@ $chrnx_search_id = wp_unique_id( 'chrnx-search-' );
|
||||
</ul>
|
||||
</nav>
|
||||
<form class="chrnx-header-search" role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" data-chrnx-search data-expanded="false">
|
||||
<label class="chrnx-screen-reader-text" for="<?php echo esc_attr( $chrnx_search_id ); ?>"><?php echo esc_html( $chrnx_search_label ); ?></label>
|
||||
<input id="<?php echo esc_attr( $chrnx_search_id ); ?>" type="search" name="s" autocomplete="off">
|
||||
<div id="<?php echo esc_attr( $chrnx_search_panel_id ); ?>" class="chrnx-header-search-row" data-chrnx-search-panel>
|
||||
<label class="chrnx-screen-reader-text" for="<?php echo esc_attr( $chrnx_search_id ); ?>"><?php echo esc_html( $chrnx_search_label ); ?></label>
|
||||
<input id="<?php echo esc_attr( $chrnx_search_id ); ?>" type="search" name="s" autocomplete="off">
|
||||
</div>
|
||||
<button
|
||||
type="submit"
|
||||
data-chrnx-search-button
|
||||
aria-controls="<?php echo esc_attr( $chrnx_search_panel_id ); ?>"
|
||||
aria-expanded="false"
|
||||
data-label-open="<?php echo esc_attr__( 'Open search', 'chrnx' ); ?>"
|
||||
data-label-submit="<?php echo esc_attr( $chrnx_search_label ); ?>"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user