-
-
Save manhleo93/1a7f20c94161ff8f2d2f7d8a6b1ccab3 to your computer and use it in GitHub Desktop.
JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thêm biểu tượng vào themes | |
wp_enqueue_style( | |
'monochrome-ionicons', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css', | |
array(), | |
CHILD_THEME_VERSION | |
); | |
# Thêm js vào themes | |
wp_enqueue_script( 'genesis-sample', CHILD_URL . '/js/genesis-sample.js', array( 'jquery' ), '1.0.0', true ); | |
# Thêm khung tìm kiếm | |
add_action( 'genesis_header', 'custom_get_header_search_toggle' ); | |
/** | |
* Outputs the header search form toggle button. | |
*/ | |
function custom_get_header_search_toggle() { | |
printf( | |
'<a href="#header-search-wrap" aria-controls="header-search-wrap" aria-expanded="false" role="button" class="toggle-header-search"><span class="screen-reader-text">%s</span><span class="ionicons ion-ios-search"></span></a>', | |
__( 'Show Search', 'genesis-sample' ) | |
); | |
} | |
add_action( 'genesis_header', 'custom_do_header_search_form' ); | |
/** | |
* Outputs the header search form. | |
*/ | |
function custom_do_header_search_form() { | |
$button = sprintf( | |
'<a href="#" role="button" aria-expanded="false" aria-controls="header-search-wrap" class="toggle-header-search close"><span class="screen-reader-text">%s</span><span class="ionicons ion-ios-close-empty"></span></a>', | |
__( 'Hide Search', 'genesis-sample' ) | |
); | |
printf( | |
'<div id="header-search-wrap" class="header-search-wrap">%s %s</div>', | |
get_search_form( false ), | |
$button | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment